#51 feat: logo del sitio editable desde el panel de administración

This commit is contained in:
2026-08-08 14:19:56 -05:00
parent 5aaaac1e45
commit 24fa4800a9
7 changed files with 157 additions and 22 deletions

26
src/stores/settings.js Normal file
View File

@@ -0,0 +1,26 @@
import { defineStore } from 'pinia'
export const useSettingsStore = defineStore('settings', {
state: () => ({
settings: null,
loaded: false
}),
getters: {
logo: (state) => state.settings?.logo || null,
address: (state) => state.settings?.address || '',
latitude: (state) => state.settings?.latitude,
longitude: (state) => state.settings?.longitude
},
actions: {
async fetchSettings(api) {
if (this.loaded) return this.settings
this.settings = await api.getStoreSettings()
this.loaded = true
return this.settings
},
setSettings(settings) {
this.settings = settings
this.loaded = true
}
}
})