mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
chore: cleanup
This commit is contained in:
+3
-24
@@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { API } from '../typings/api';
|
||||
import { API, APICache } from '../typings/api';
|
||||
import { Status } from '../typings/common';
|
||||
import { StationJSONData } from './typings';
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
@@ -68,17 +68,6 @@ export const useApiStore = defineStore('apiStore', {
|
||||
},
|
||||
|
||||
async fetchActiveData() {
|
||||
// if (import.meta.env.VITE_API_ACTIVE_DATA_MODE == 'mocking') {
|
||||
// import('../../tests/data/getActiveData.json').then((data) => {
|
||||
// console.warn('activeData: mocking mode');
|
||||
// this.activeData = data.default as API.ActiveData.Response;
|
||||
|
||||
// this.dataStatuses.connection = Status.Data.Loaded;
|
||||
// });
|
||||
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (!this.activeData) this.dataStatuses.connection = Status.Data.Loading;
|
||||
|
||||
try {
|
||||
@@ -105,7 +94,7 @@ export const useApiStore = defineStore('apiStore', {
|
||||
async fetchStationsGeneralInfo() {
|
||||
try {
|
||||
const sceneryData: StationJSONData[] = (
|
||||
await this.client!.get<StationJSONData[]>('api/getSceneries')
|
||||
await this.client!.get<StationJSONData[]>(`api/getSceneries`)
|
||||
).data;
|
||||
|
||||
this.dataStatuses.sceneries = Status.Data.Loaded;
|
||||
@@ -117,16 +106,6 @@ export const useApiStore = defineStore('apiStore', {
|
||||
},
|
||||
|
||||
async fetchVehiclesInfo() {
|
||||
// if (import.meta.env.VITE_API_VEHICLES_MODE == 'mocking') {
|
||||
// import('../../tests/data/vehicles.json').then((data) => {
|
||||
// console.warn('vehicles.json: mocking mode');
|
||||
// this.vehiclesData = data.default;
|
||||
// this.dataStatuses.vehicles = Status.Data.Loaded;
|
||||
// });
|
||||
|
||||
// return;
|
||||
// }
|
||||
|
||||
try {
|
||||
const response = await this.client!.get<API.Vehicles.Response>('api/getVehicles');
|
||||
|
||||
@@ -136,6 +115,6 @@ export const useApiStore = defineStore('apiStore', {
|
||||
this.dataStatuses.vehicles = Status.Data.Error;
|
||||
console.error('Ups! Wystąpił błąd podczas pobierania informacji o pojazdach:', error);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user