Adjust train supression
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
8bab3ddda5
commit
1c593bb6c2
@ -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: checkIsSupressed(service).toString(),
|
serviceIsSupressed: checkIsSupressed(service),
|
||||||
origin: transformLocation(service?.origin),
|
origin: transformLocation(service?.origin),
|
||||||
destination: transformLocation(service?.destination),
|
destination: transformLocation(service?.destination),
|
||||||
length: calculateLength(service),
|
length: calculateLength(service),
|
||||||
@ -106,9 +106,12 @@ function transformTrainServices(input: any): TrainServices[] {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkIsSupressed(service: TrainServices): boolean {
|
function checkIsSupressed(service: TrainServices): string | undefined {
|
||||||
// RETURN TRUE if 'serviceIsSupressed' OR 'isNonPublic'
|
if (service.serviceIsSupressed === "true" || service.isNonPublic === "true") {
|
||||||
return service.serviceIsSupressed == "true" || service.isNonPublic == "true";
|
return "true";
|
||||||
|
} else {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformLocation(input: any): ServiceLocation[] {
|
function transformLocation(input: any): ServiceLocation[] {
|
||||||
|
Loading…
Reference in New Issue
Block a user