fix issues

This commit is contained in:
Marshal
2026-08-28 10:34:02 +00:00
parent ba56974e32
commit 3015de7508
14 changed files with 435 additions and 49 deletions

View File

@@ -1043,13 +1043,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,
),

View File

@@ -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);
},