2FAuth/resources/js_vue3/stores/user.js

23 lines
441 B
JavaScript
Raw Normal View History

2023-09-22 15:07:47 +02:00
import { defineStore } from 'pinia'
// import { useApi } from '@/api/useAPI.js'
// const api = useApi()
export const useUserStore = defineStore({
id: 'user',
state: () => {
return {
name: 'guest',
preferences: window.userPreferences,
isAdmin: false,
}
},
actions: {
updatePreference(preference) {
this.preferences = { ...this.state.preferences, ...preference }
},
},
})