mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 22:25:42 +00:00
Merge pull request #1437 from Tria-plc/freight_feature/usermanagement
fix issues
This commit is contained in:
@@ -1044,13 +1044,17 @@ export const api = {
|
||||
),
|
||||
|
||||
cancelSchedule: endpoint<
|
||||
{ id: string; freightType?: FreightType },
|
||||
{ id: string; freightType?: FreightType; reason: string },
|
||||
TrainScheduleDetail
|
||||
>(
|
||||
"train-scheduling",
|
||||
"cancel-schedule",
|
||||
({ id, freightType }) =>
|
||||
trainSchedulingService.cancelSchedule(id, freightType ?? "CONTAINER"),
|
||||
({ id, freightType, reason }) =>
|
||||
trainSchedulingService.cancelSchedule(
|
||||
id,
|
||||
freightType ?? "CONTAINER",
|
||||
reason,
|
||||
),
|
||||
undefined,
|
||||
() => TRAIN_SCHEDULING_INVALIDATIONS,
|
||||
),
|
||||
|
||||
@@ -801,12 +801,13 @@ export const trainSchedulingService = {
|
||||
cancelSchedule: async (
|
||||
id: string,
|
||||
freightType: FreightType = "CONTAINER",
|
||||
reason?: string,
|
||||
): Promise<TrainScheduleDetail> => {
|
||||
const response = await client.post<TrainScheduleDetail>(
|
||||
pathsFor(
|
||||
freightType === "MIXED" ? undefined : freightType,
|
||||
).CANCEL_SCHEDULE(id),
|
||||
{},
|
||||
{ reason },
|
||||
);
|
||||
return unwrap(response.data);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user