koel/resources/assets/js/stores/setting.ts
2022-04-22 00:20:21 +02:00

21 lines
396 B
TypeScript

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