Trains management CRUD issues solved

This commit is contained in:
hagiye
2026-06-05 21:07:04 +03:00
parent 9676a6bb56
commit dc42838a43
41 changed files with 2192 additions and 1830 deletions

View File

@@ -14,7 +14,7 @@ import type {
} from '@/types/trainScheduling';
interface BookingReferenceDataResponse {
yard?: YardOption[];
yard?: Array<YardOption & { label?: string }>;
}
export const trainSchedulingService = {
@@ -82,6 +82,11 @@ export const trainSchedulingService = {
URL_CONSTANTS.BOOKINGS.REFERENCE_DATA,
);
const data = unwrap(response.data);
return data.yard ?? [];
return (data.yard ?? []).map((yard) => ({
id: yard.id,
name: yard.name ?? yard.label ?? yard.code,
code: yard.code,
country: yard.country,
}));
},
};