diff --git a/src/stores/app.js b/src/stores/app.js index d950af10..d03f09eb 100644 --- a/src/stores/app.js +++ b/src/stores/app.js @@ -1,5 +1,5 @@ import { defineStore } from 'pinia'; -import { jApi } from '@/boot/axios'; +import { jApi, api } from '@/boot/axios'; import useNotify from '@/composables/useNotify.js'; import { i18n } from '@/boot/i18n'; import { useQuasar } from 'quasar'; @@ -56,9 +56,18 @@ export const useAppStore = defineStore('hedera', { this.menuEssentialLinks = sectionTree; }, + async loadConfig() { - const imageUrl = await jApi.getValue('SELECT url FROM imageConfig'); - this.$patch({ imageUrl }); + try { + const { data } = await api.get('/ImageConfigs/getImageConfig'); + + if (!data) return; + + const [config] = data; + this.imageUrl = config?.url; + } catch (err) { + console.error(err); + } }, async init() {