koel/resources/assets/js/stores/settingStore.ts
2024-10-14 00:37:01 +07:00

18 lines
370 B
TypeScript

import { reactive } from 'vue'
import { http } from '@/services'
import { merge } from 'lodash'
export const settingStore = {
state: reactive<Settings>({
media_path: '',
}),
init (settings: Settings) {
merge(this.state, settings)
},
async update (settings: Settings) {
await http.put('settings', settings)
merge(this.state, settings)
},
}