fix: translate

This commit is contained in:
2026-04-01 09:36:01 +02:00
parent d6066e39ce
commit b829bf2185
6 changed files with 264 additions and 173 deletions

View File

@@ -2,13 +2,19 @@ import { useFetchJson } from '@/composable/useFetchJson'
import type { Resp } from '@/types'
import type { Settings } from '@/types/settings'
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useSettingsStore = defineStore('settings', () => {
async function getSettings() {
const { items } = await useFetchJson<Resp<Settings>>('/api/v1/settings',)
console.log(items);
const settings = ref<Settings | null>(null)
const loaded = ref(false)
async function getSettings(): Promise<Settings | null> {
if (loaded.value && settings.value) return settings.value
const resp = await useFetchJson<Settings>('/api/v1/settings')
settings.value = resp.items
loaded.value = true
return resp.items
}
getSettings()
return {}
return { settings, loaded, getSettings }
})