chore(api): url changes

This commit is contained in:
2024-04-08 23:40:24 +02:00
parent 31302cc053
commit 9c59c30f12
4 changed files with 16 additions and 1420 deletions
+13 -3
View File
@@ -21,8 +21,7 @@ import {
} from './utils/vehicleUtils';
import i18n from './i18n-setup';
import vehiclesData from './data/vehiclesData.json';
import http from './http';
export const useStore = defineStore({
id: 'store',
@@ -123,8 +122,19 @@ export const useStore = defineStore({
},
actions: {
async fetchVehiclesAPI() {
try {
const vehiclesData = (await http.get<IVehiclesData>('/vehicles')).data;
this.vehiclesData = vehiclesData;
console.log(vehiclesData);
} catch (error) {
console.error(error);
}
},
async setupAPIData() {
this.vehiclesData = vehiclesData;
await this.fetchVehiclesAPI();
this.mergeBackendTranslations();
},