Temporarily disable PIS and TRAIN auth reference: #71
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
ac9372515f
commit
8e0b928f27
@ -5,7 +5,7 @@ interface versions {
|
|||||||
|
|
||||||
const version: versions = {
|
const version: versions = {
|
||||||
api: ["/api/v2"],
|
api: ["/api/v2"],
|
||||||
app: "2024.2.3",
|
app: "2024.3.0",
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = version;
|
module.exports = version;
|
||||||
|
@ -2,11 +2,11 @@ const pis = require("../services/pis.services");
|
|||||||
|
|
||||||
/* Used in /api/v2 */
|
/* Used in /api/v2 */
|
||||||
async function byStartEndCRS(req, res, next) {
|
async function byStartEndCRS(req, res, next) {
|
||||||
if (!req.isAuthed) {
|
// if (!req.isAuthed) {
|
||||||
const err = new Error("Unauthorized");
|
// const err = new Error("Unauthorized");
|
||||||
err.status = 401;
|
// err.status = 401;
|
||||||
return next(err);
|
// return next(err);
|
||||||
}
|
// }
|
||||||
try {
|
try {
|
||||||
let startCrs = req.params.startCrs;
|
let startCrs = req.params.startCrs;
|
||||||
let endCrs = req.params.endCrs;
|
let endCrs = req.params.endCrs;
|
||||||
@ -19,11 +19,11 @@ async function byStartEndCRS(req, res, next) {
|
|||||||
|
|
||||||
/* Used in /api/v2 */
|
/* Used in /api/v2 */
|
||||||
async function byCode(req, res, next) {
|
async function byCode(req, res, next) {
|
||||||
if (!req.isAuthed) {
|
// if (!req.isAuthed) {
|
||||||
const err = new Error("Unauthorized");
|
// const err = new Error("Unauthorized");
|
||||||
err.status = 401;
|
// err.status = 401;
|
||||||
return next(err);
|
// return next(err);
|
||||||
}
|
// }
|
||||||
try {
|
try {
|
||||||
let code = req.params.code;
|
let code = req.params.code;
|
||||||
res.json(await pis.findPisByCode(code));
|
res.json(await pis.findPisByCode(code));
|
||||||
@ -34,11 +34,11 @@ async function byCode(req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function random(req, res, next) {
|
async function random(req, res, next) {
|
||||||
if (!req.isAuthed) {
|
// if (!req.isAuthed) {
|
||||||
const err = new Error("Unauthorized");
|
// const err = new Error("Unauthorized");
|
||||||
err.status = 401;
|
// err.status = 401;
|
||||||
return next(err);
|
// return next(err);
|
||||||
}
|
// }
|
||||||
try {
|
try {
|
||||||
res.json(await pis.findRandom());
|
res.json(await pis.findRandom());
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -5,11 +5,11 @@ const train = require("../services/trainService.services");
|
|||||||
async function getByHeadcodeToday(req, res, next) {
|
async function getByHeadcodeToday(req, res, next) {
|
||||||
// Deprecated - for future removal.
|
// Deprecated - for future removal.
|
||||||
logger.warn("Deprecated Function Called - trainService.services-getByHeadcodeToday")
|
logger.warn("Deprecated Function Called - trainService.services-getByHeadcodeToday")
|
||||||
if (!req.isAuthed) {
|
// if (!req.isAuthed) {
|
||||||
const err = new Error("Unauthorized");
|
// const err = new Error("Unauthorized");
|
||||||
err.status = 401;
|
// err.status = 401;
|
||||||
next(err);
|
// next(err);
|
||||||
}
|
// }
|
||||||
try {
|
try {
|
||||||
var searchHeadcode = req.params.id;
|
var searchHeadcode = req.params.id;
|
||||||
res.json(await train.findByHeadcodeToday(searchHeadcode));
|
res.json(await train.findByHeadcodeToday(searchHeadcode));
|
||||||
@ -21,11 +21,11 @@ async function getByHeadcodeToday(req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function get(req, res, next) {
|
async function get(req, res, next) {
|
||||||
if (!req.isAuthed) {
|
// if (!req.isAuthed) {
|
||||||
const err = new Error("Unauthorized");
|
// const err = new Error("Unauthorized");
|
||||||
err.status = 401;
|
// err.status = 401;
|
||||||
next(err);
|
// next(err);
|
||||||
}
|
// }
|
||||||
let date = req.params.date;
|
let date = req.params.date;
|
||||||
let searchType = req.params.searchType;
|
let searchType = req.params.searchType;
|
||||||
let id = req.params.id;
|
let id = req.params.id;
|
||||||
|
Loading…
Reference in New Issue
Block a user