api & naming changes

This commit is contained in:
2024-04-06 14:54:54 +02:00
parent 90824dc0e5
commit 27f02e2c2b
20 changed files with 168 additions and 175 deletions
+7 -3
View File
@@ -6,6 +6,8 @@ import {
IVehicle,
IStock,
IRealComposition,
LocoGroupType,
WagonGroupType,
} from './types';
import { defineStore } from 'pinia';
import {
@@ -33,8 +35,8 @@ export const useStore = defineStore({
imageLoading: false,
chosenLocoPower: 'loco-e',
chosenCarUseType: 'car-passenger',
chosenLocoGroup: 'loco-electric' as LocoGroupType,
chosenCarGroup: 'wagon-passenger' as WagonGroupType,
stockList: [] as IStock[],
cargoOptions: [] as any[][],
@@ -123,8 +125,10 @@ export const useStore = defineStore({
actions: {
async fetchVehiclesAPI() {
try {
const vehiclesData = (await http.get<IVehiclesAPI>('/vehicles.json')).data;
const vehiclesData = (await http.get<IVehiclesAPI>('/vehiclesData')).data;
this.vehiclesAPIData = vehiclesData;
console.log(vehiclesData);
} catch (error) {
console.error(error);
}