Improve editing and creating of transactions
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-02-27 21:15:46 +00:00
parent faef975f1a
commit 4c6d21c2b4
7 changed files with 32 additions and 22 deletions

View File

@ -206,12 +206,13 @@ export const useAccountStore = defineStore("budget/account", {
async saveTransaction(payload: string) {
const result = await POST("/transaction/new", payload);
const response = await result.json();
this.CurrentAccount?.Transactions.unshift(response);
this.AddTransaction(this.CurrentAccount!, response);
this.CurrentAccount?.Transactions.unshift(response.ID);
},
async editTransaction(transactionid: string, payload: string) {
const result = await POST("/transaction/" + transactionid, payload);
const response = await result.json();
this.CurrentAccount?.Transactions.unshift(response);
this.AddTransaction(this.CurrentAccount!, response);
}
}