From d39694007192f8f2b107887cd02511e0cac31898 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 29 Jan 2021 04:38:20 +0100 Subject: [PATCH] First try with an overview page for the balance --- src/plugins/balance/pages/Overview.vue | 151 ++++++++++++++++++------- src/plugins/balance/store/balance.ts | 13 ++- 2 files changed, 121 insertions(+), 43 deletions(-) diff --git a/src/plugins/balance/pages/Overview.vue b/src/plugins/balance/pages/Overview.vue index dd94ad6..10dc436 100644 --- a/src/plugins/balance/pages/Overview.vue +++ b/src/plugins/balance/pages/Overview.vue @@ -1,71 +1,140 @@ diff --git a/src/plugins/balance/store/balance.ts b/src/plugins/balance/store/balance.ts index c74f81d..3538d37 100644 --- a/src/plugins/balance/store/balance.ts +++ b/src/plugins/balance/store/balance.ts @@ -69,7 +69,7 @@ const mutations: MutationTree = { }, reverseTransaction(state, data: { transaction: FG.Transaction; reversal: FG.Transaction }) { const idx = state.transactions.findIndex(value => value.id === data.transaction.id); - data.transaction.reversal = data.reversal; + data.transaction.reversal_id = data.reversal.id; if (idx > -1) state.transactions[idx] = data.transaction; else state.transactions.push(data.transaction); } @@ -78,7 +78,7 @@ const mutations: MutationTree = { const actions: ActionTree = { addShortcut({ commit, state, rootState }, shortcut) { const sc = [...state.shortcuts, shortcut]; - sc.sort().reverse(); + sc.sort(); const user = rootState.user.currentUser; return axios.put(`/users/${user.userid}/balance/shortcuts`, sc).then(() => { @@ -136,6 +136,15 @@ const actions: ActionTree = { }) .finally(() => commit('setLoading', false)); }, + getTransactionsCount( + { state }, + payload: { + userid?: string; + filter?: { limit?: number; offset?: number; from?: Date; to?: Date }; + } + ) { + return Promise.resolve(3); + }, getLimit({ rootState, commit }) { commit('setLoading'); axios