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
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -3,8 +3,8 @@ import axios from 'axios';
const http = axios.create({
baseURL:
import.meta.env.VITE_API_DEV === '1' && import.meta.env.DEV
? 'http://localhost:5500'
: 'https://static.spythere.eu',
? 'http://localhost:3001'
: 'https://spythere.spythere.eu',
});
export default http;
+1 -5
View File
@@ -7,11 +7,7 @@ export default defineComponent({
},
getThumbnailURL(vehicleType: string, size: 'small' | 'large') {
return `${
import.meta.env.VITE_API_DEV === '1'
? 'http://localhost:5500'
: 'https://static.spythere.eu'
}/images/${vehicleType}--${size == 'small' ? 300 : 800}px.jpg`;
return `https://static.spythere.eu/images/${vehicleType}--${size == 'small' ? 300 : 800}px.jpg`;
},
},
});
+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();
},