Pass is_open to API from EditAccount

This commit is contained in:
Jan Bader 2022-03-02 21:16:06 +00:00
parent f26ee8f472
commit a0cabbf4f7
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ const accountOnBudget = ref(true);
const accountOpen = ref(true); const accountOpen = ref(true);
function editAccount(e : any) { function editAccount(e : any) {
accountStore.EditAccount(CurrentAccount.value?.ID ?? "", accountName.value, accountOnBudget.value); accountStore.EditAccount(CurrentAccount.value?.ID ?? "", accountName.value, accountOnBudget.value, accountOpen.value);
} }
function openEditAccount(e : any) { function openEditAccount(e : any) {

View File

@ -124,8 +124,8 @@ export const useAccountStore = defineStore("budget/account", {
return; return;
this.addCategoriesForMonth(year, month, response.Categories); this.addCategoriesForMonth(year, month, response.Categories);
}, },
async EditAccount(accountid: string, name: string, onBudget: boolean) { async EditAccount(accountid: string, name: string, onBudget: boolean, isOpen: boolean) {
const result = await POST("/account/" + accountid, JSON.stringify({ name: name, onBudget: onBudget })); const result = await POST("/account/" + accountid, JSON.stringify({ name: name, onBudget: onBudget, isOpen: isOpen }));
const response = await result.json(); const response = await result.json();
useBudgetsStore().MergeBudgetingData(response); useBudgetsStore().MergeBudgetingData(response);
}, },