newStaffLDB-API #48

Merged
fred.boniface merged 85 commits from newStaffLDB-API into main 2023-10-03 21:35:03 +01:00
Showing only changes of commit 843a6cad97 - Show all commits

View File

@ -16,7 +16,7 @@ export function transform(input: any): StaffLdb | null {
try { try {
output = { output = {
generatedAt: transformDateTime(data?.generatedAt) || new Date(), generatedAt: transformDateTime(data?.generatedAt) || new Date(),
locationName: data?.locationName || "Not Found", locationName: data?.locationName || 'Not Found',
stationManagerCode: data?.stationManagerCode || "UK", stationManagerCode: data?.stationManagerCode || "UK",
nrccMessages: transformNrcc(data?.nrccMessages) || undefined, nrccMessages: transformNrcc(data?.nrccMessages) || undefined,
trainServices: transformTrainServices(data?.trainServices) || undefined, trainServices: transformTrainServices(data?.trainServices) || undefined,
@ -24,7 +24,9 @@ export function transform(input: any): StaffLdb | null {
ferryServices: transformTrainServices(data?.ferryServices) || undefined, ferryServices: transformTrainServices(data?.ferryServices) || undefined,
}; };
console.timeEnd("StaffLdb Transformation"); console.timeEnd("StaffLdb Transformation");
if (output.locationName !== 'Not Found') {
return output; return output;
}
} catch (err) { } catch (err) {
console.log("utils/translators/ldb/staffLdb.transform: Caught Error"); console.log("utils/translators/ldb/staffLdb.transform: Caught Error");
console.log("Unable to parse data, assuming no data: " + err); console.log("Unable to parse data, assuming no data: " + err);