mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 11:45:34 +00:00
chore(api): url changes
This commit is contained in:
+13
-3
@@ -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();
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user