refactor: journals

This commit is contained in:
2024-04-08 23:21:50 +02:00
parent f53993c717
commit 5750490f01
12 changed files with 355 additions and 257 deletions
+4 -3
View File
@@ -57,7 +57,7 @@ export const useApiStore = defineStore('apiStore', {
// Active data schedueler
this.fetchActiveData();
this.setupActiveDataFetcher();
// this.setupActiveDataFetcher();
},
async setupActiveDataFetcher() {
@@ -72,13 +72,14 @@ export const useApiStore = defineStore('apiStore', {
if (!this.activeData) this.dataStatuses.connection = Status.Data.Loading;
try {
console.log('Fetching active data at ' + new Date().toLocaleTimeString('pl-PL'));
const response = await this.client!.get<API.ActiveData.Response>('api/getActiveData');
console.log(response);
this.activeData = response.data;
this.lastFetchData = new Date();
this.dataStatuses.connection = Status.Data.Loaded;
console.log('Fetching active data at ' + new Date().toLocaleTimeString('pl-PL'));
} catch (error) {
this.dataStatuses.connection = Status.Data.Error;
console.error('Ups! Wystąpił błąd podczas pobierania danych online:', error);