Remove vuex

This commit is contained in:
2022-02-10 15:49:21 +00:00
parent 8b0e368d58
commit c693625e34
21 changed files with 322 additions and 351 deletions

View File

@ -20,35 +20,9 @@ export const useSessionStore = defineStore('session', {
Budgets: new Map<string, Budget>(),
}),
getters: {
Budgets(): IterableIterator<Budget> {
return this.Budgets.values();
},
AuthHeaders(): HeadersInit {
return {
'Authorization': 'Bearer ' + this.Token
}
},
/*// must define return type because of using `this`
fullUserDetails (state): FullUserDetails {
// import from other stores
const authPreferencesStore = useAuthPreferencesStore()
const authEmailStore = useAuthEmailStore()
return {
...state,
// other getters now on `this`
fullName: this.fullName,
...authPreferencesStore.$state,
...authEmailStore.details
}
// alternative if other modules are still in Vuex
// return {
// ...state,
// fullName: this.fullName,
// ...vuexStore.state.auth.preferences,
// ...vuexStore.getters['auth/email'].details
// }
}*/
BudgetsList: (state) => state.Budgets.values(),
AuthHeaders: (state) => ({'Authorization': 'Bearer ' + state.Token}),
LoggedIn: (state) => state.Token != null,
},
actions: {
setTitle(title : string) {