And on
This commit is contained in:
parent
9b8ae7a44d
commit
0c094d6f6b
@ -1,22 +1,4 @@
|
||||
import { InjectionKey } from 'vue'
|
||||
import { createStore, Store, createLogger } from 'vuex'
|
||||
import { LOGIN_SUCCESS, LOGOUT, TITLE } from './mutation-types'
|
||||
import { FETCH_ACCOUNT, FETCH_BUDGET, GET, REGISTER, IMPORT_YNAB, LOGIN, NEW_BUDGET, POST, SET_CURRENT_ACCOUNT, SET_CURRENT_BUDGET } from './action-types'
|
||||
import { budgetStore } from './budget'
|
||||
import { Budget, useSessionStore } from '../stores/session'
|
||||
|
||||
export const key: InjectionKey<Store<State>> = Symbol()
|
||||
|
||||
export const store = createStore<State>({
|
||||
state: {
|
||||
ShowMenu: undefined,
|
||||
CurrentBudgetID: undefined,
|
||||
},
|
||||
mutations: {
|
||||
[TITLE](state, title) {
|
||||
document.title = "Budgeteer - " + title;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
[IMPORT_YNAB]({ getters, dispatch }, formData) {
|
||||
return dispatch("POST", { path: "/budget/" + getters.CurrentBudget.ID + "/import/ynab", body: formData });
|
||||
|
@ -51,6 +51,9 @@ export const useSessionStore = defineStore('session', {
|
||||
}*/
|
||||
},
|
||||
actions: {
|
||||
setTitle(title : string) {
|
||||
document.title = "Budgeteer - " + title;
|
||||
},
|
||||
loginSuccess(x : any) {
|
||||
this.User = x.User;
|
||||
this.Token = x.Token;
|
||||
|
Loading…
x
Reference in New Issue
Block a user