mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 09:58:12 +00:00
Trains management CRUD issues solved
This commit is contained in:
@@ -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,
|
||||
}));
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user