Merge pull request 'imageConfig query refactor front' (!117) from wbuezas/hedera-web-mindshore:feature/imageConfig-query into beta
gitea/hedera-web/pipeline/head This commit looks good Details

Reviewed-on: #117
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
Javier Segarra 2025-02-27 19:28:39 +00:00
commit 47c61a7b35
1 changed files with 11 additions and 3 deletions

View File

@ -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,17 @@ 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');
if (!data) return;
this.imageUrl = data[0]?.url;
} catch (err) {
console.error(err);
}
},
async init() {