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:
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -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;
|
||||
|
||||
@@ -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
@@ -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