Merge pull request #1437 from Tria-plc/freight_feature/usermanagement

fix issues
This commit is contained in:
marshal
2026-08-28 13:35:20 +03:00
committed by GitHub
14 changed files with 435 additions and 49 deletions

View File

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

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