mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 19:48:11 +00:00
refactor(api): changed fetching data from the new api endpoint
This commit is contained in:
+4
-1
@@ -130,7 +130,10 @@ export const useStore = defineStore('store', {
|
||||
async fetchVehiclesAPI() {
|
||||
try {
|
||||
const response = await this.httpClient.get<API.VehiclesData.Response>('api/getVehiclesData');
|
||||
// this.vehiclesData = response.;
|
||||
this.vehiclesData = response.vehicles.map((v) => ({
|
||||
...v,
|
||||
group: response.vehicleGroups.find((g) => g.id == v.vehicleGroupsId)!,
|
||||
}));
|
||||
|
||||
console.log(response);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user