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