mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 19:48:11 +00:00
chore(api): url changes
This commit is contained in:
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -3,8 +3,8 @@ import axios from 'axios';
|
|||||||
const http = axios.create({
|
const http = axios.create({
|
||||||
baseURL:
|
baseURL:
|
||||||
import.meta.env.VITE_API_DEV === '1' && import.meta.env.DEV
|
import.meta.env.VITE_API_DEV === '1' && import.meta.env.DEV
|
||||||
? 'http://localhost:5500'
|
? 'http://localhost:3001'
|
||||||
: 'https://static.spythere.eu',
|
: 'https://spythere.spythere.eu',
|
||||||
});
|
});
|
||||||
|
|
||||||
export default http;
|
export default http;
|
||||||
|
|||||||
@@ -7,11 +7,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getThumbnailURL(vehicleType: string, size: 'small' | 'large') {
|
getThumbnailURL(vehicleType: string, size: 'small' | 'large') {
|
||||||
return `${
|
return `https://static.spythere.eu/images/${vehicleType}--${size == 'small' ? 300 : 800}px.jpg`;
|
||||||
import.meta.env.VITE_API_DEV === '1'
|
|
||||||
? 'http://localhost:5500'
|
|
||||||
: 'https://static.spythere.eu'
|
|
||||||
}/images/${vehicleType}--${size == 'small' ? 300 : 800}px.jpg`;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+13
-3
@@ -21,8 +21,7 @@ import {
|
|||||||
} from './utils/vehicleUtils';
|
} from './utils/vehicleUtils';
|
||||||
|
|
||||||
import i18n from './i18n-setup';
|
import i18n from './i18n-setup';
|
||||||
|
import http from './http';
|
||||||
import vehiclesData from './data/vehiclesData.json';
|
|
||||||
|
|
||||||
export const useStore = defineStore({
|
export const useStore = defineStore({
|
||||||
id: 'store',
|
id: 'store',
|
||||||
@@ -123,8 +122,19 @@ export const useStore = defineStore({
|
|||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
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() {
|
async setupAPIData() {
|
||||||
this.vehiclesData = vehiclesData;
|
await this.fetchVehiclesAPI();
|
||||||
this.mergeBackendTranslations();
|
this.mergeBackendTranslations();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user