chorse: changed api data to stored locally

This commit is contained in:
2024-04-08 22:20:18 +02:00
parent 26fd0c67e4
commit 31302cc053
6 changed files with 1439 additions and 38 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import {
ICarWagon,
ILocomotive,
IStock,
IVehiclesAPI,
IVehiclesData,
LocoGroupType,
WagonGroupType,
} from '../types';
@@ -17,7 +17,7 @@ export function isTractionUnit(vehicle: ILocomotive | ICarWagon): vehicle is ILo
return (vehicle as ILocomotive).cabinType !== undefined;
}
export function locoDataList(vehiclesData: IVehiclesAPI | undefined) {
export function locoDataList(vehiclesData: IVehiclesData | undefined) {
if (!vehiclesData) return [];
return vehiclesData.vehicleList.reduce<ILocomotive[]>((acc, vehicleInfoArray) => {
@@ -53,7 +53,7 @@ export function locoDataList(vehiclesData: IVehiclesAPI | undefined) {
}, []);
}
export function carDataList(vehiclesData: IVehiclesAPI | undefined) {
export function carDataList(vehiclesData: IVehiclesData | undefined) {
if (!vehiclesData) return [];
console.log(vehiclesData);