Compare commits
No commits in common. "ac9372515ffda6141d4c7f027ea29690c9e93d87" and "d15b7c3c7abdbc4faf5550db33ad6037dc569944" have entirely different histories.
ac9372515f
...
d15b7c3c7a
2
app.js
2
app.js
|
@ -60,7 +60,7 @@ app.use(
|
|||
);
|
||||
app.use(express.json()); //JSON Parsing for POST Requests
|
||||
app.use(compression()); // Compress API Data if supported by client
|
||||
//app.use(limiter);
|
||||
app.use(limiter);
|
||||
app.use(authenticate);
|
||||
|
||||
// 2023 Rationalisation Routes (/api/v2, /misc)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"ldbs-json": "^1.2.1",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"mongodb": "^4.13.0",
|
||||
"nodemailer": "^6.9.9",
|
||||
"nodemailer": "^6.9.1",
|
||||
"pino": "^8.15.1",
|
||||
"redis": "^4.6.7",
|
||||
"zlib": "^1.0.5"
|
||||
|
|
|
@ -5,7 +5,7 @@ interface versions {
|
|||
|
||||
const version: versions = {
|
||||
api: ["/api/v2"],
|
||||
app: "2024.2.3",
|
||||
app: "2024.2.2",
|
||||
};
|
||||
|
||||
module.exports = version;
|
||||
|
|
|
@ -56,12 +56,10 @@ export async function findByTrainUid(
|
|||
) {
|
||||
// Set the correct date - whether a date or "now" was passed to function
|
||||
let queryDate: Date;
|
||||
if (date === 'now') {
|
||||
queryDate = new Date();
|
||||
} else if (date instanceof Date) {
|
||||
if (date instanceof Date) {
|
||||
queryDate = date;
|
||||
} else {
|
||||
queryDate = new Date(date);
|
||||
queryDate = new Date();
|
||||
}
|
||||
|
||||
// Build query
|
||||
|
@ -71,7 +69,6 @@ export async function findByTrainUid(
|
|||
scheduleEndDate: { $gte: queryDate },
|
||||
daysRun: { $in: [getShortDay(queryDate)] },
|
||||
};
|
||||
logger.debug(query)
|
||||
const pipeline = getFindByTrainUidPipeline(query);
|
||||
|
||||
const result = (await queryAggregate("timetable", pipeline)) as Service[];
|
||||
|
@ -85,7 +82,7 @@ export async function findByTrainUid(
|
|||
} else {
|
||||
pis = null;
|
||||
}
|
||||
console.log(JSON.stringify(services[0]))
|
||||
// TODO: Format and return data, the function called is not yet complete
|
||||
return formatTimetableDetail(services[0], pis);
|
||||
}
|
||||
|
||||
|
@ -138,8 +135,6 @@ function filterServices(services: SimpleService[]): SimpleService[] {
|
|||
> = {};
|
||||
let filteredServices: SimpleService[] = [];
|
||||
|
||||
console.log(services)
|
||||
|
||||
for (const service of services) {
|
||||
const trainUid = service["trainUid"],
|
||||
stpIndicator = service["stpIndicator"];
|
||||
|
|
Loading…
Reference in New Issue