diff --git a/http/always-needed-data.go b/http/always-needed-data.go index c2a8dab..816a7e3 100644 --- a/http/always-needed-data.go +++ b/http/always-needed-data.go @@ -9,10 +9,8 @@ import ( ) type AlwaysNeededData struct { - Budget postgres.Budget - Accounts []postgres.GetAccountsWithBalanceRow - OnBudgetAccounts []postgres.GetAccountsWithBalanceRow - OffBudgetAccounts []postgres.GetAccountsWithBalanceRow + Budget postgres.Budget + Accounts []postgres.GetAccountsWithBalanceRow } func (h *Handler) getImportantData(c *gin.Context) { @@ -36,20 +34,9 @@ func (h *Handler) getImportantData(c *gin.Context) { return } - var onBudgetAccounts, offBudgetAccounts []postgres.GetAccountsWithBalanceRow - for _, account := range accounts { - if account.OnBudget { - onBudgetAccounts = append(onBudgetAccounts, account) - } else { - offBudgetAccounts = append(offBudgetAccounts, account) - } - } - base := AlwaysNeededData{ - Accounts: accounts, - OnBudgetAccounts: onBudgetAccounts, - OffBudgetAccounts: offBudgetAccounts, - Budget: budget, + Accounts: accounts, + Budget: budget, } c.Set("data", base) diff --git a/web/src/pages/Budget.vue b/web/src/pages/Budget.vue index 68c1063..a84d7f2 100644 --- a/web/src/pages/Budget.vue +++ b/web/src/pages/Budget.vue @@ -8,6 +8,51 @@ export default {