newStaffLDB-API #48
@ -82,7 +82,7 @@ function transformTrainServices(input: any): TrainServices[] {
|
|||||||
operatorCode: service?.operatorCode || "UK",
|
operatorCode: service?.operatorCode || "UK",
|
||||||
platform: service?.platform || "-",
|
platform: service?.platform || "-",
|
||||||
platformIsHidden: service?.platformIsHidden,
|
platformIsHidden: service?.platformIsHidden,
|
||||||
serviceIsSupressed: service?.serviceIsSupressed,
|
serviceIsSupressed: checkIsSupressed(service).toString(),
|
||||||
origin: transformLocation(service?.origin),
|
origin: transformLocation(service?.origin),
|
||||||
destination: transformLocation(service?.destination),
|
destination: transformLocation(service?.destination),
|
||||||
length: calculateLength(service),
|
length: calculateLength(service),
|
||||||
@ -106,6 +106,11 @@ function transformTrainServices(input: any): TrainServices[] {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkIsSupressed(service: TrainServices): boolean {
|
||||||
|
// RETURN TRUE if 'serviceIsSupressed' OR 'isNonPublic'
|
||||||
|
return service.serviceIsSupressed == "true" || service.isNonPublic == "true";
|
||||||
|
}
|
||||||
|
|
||||||
function transformLocation(input: any): ServiceLocation[] {
|
function transformLocation(input: any): ServiceLocation[] {
|
||||||
//console.log("Transform Location Running")
|
//console.log("Transform Location Running")
|
||||||
let output: ServiceLocation[] = [];
|
let output: ServiceLocation[] = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user