diff --git a/http/accounts.go b/http/accounts.go index dddb8a2..09fe886 100644 --- a/http/accounts.go +++ b/http/accounts.go @@ -13,20 +13,21 @@ type AccountsData struct { } func (h *Handler) accounts(c *gin.Context) { - base := c.MustGet("data").(AlwaysNeededData) d := AccountsData{ - base, + c.MustGet("data").(AlwaysNeededData), } c.HTML(http.StatusOK, "accounts.html", d) } type AccountData struct { + AlwaysNeededData Account *postgres.Account Transactions []postgres.GetTransactionsForAccountRow } func (h *Handler) account(c *gin.Context) { + accountID := c.Param("accountid") accountUUID, err := uuid.Parse(accountID) if err != nil { @@ -47,8 +48,9 @@ func (h *Handler) account(c *gin.Context) { } d := AccountData{ - Account: &account, - Transactions: transactions, + c.MustGet("data").(AlwaysNeededData), + &account, + transactions, } c.HTML(http.StatusOK, "account.html", d) diff --git a/http/budget.go b/http/budget.go index bef1b8a..71560f3 100644 --- a/http/budget.go +++ b/http/budget.go @@ -15,7 +15,6 @@ type BudgetData struct { } func (h *Handler) budget(c *gin.Context) { - base := c.MustGet("data").(AlwaysNeededData) budgetID := c.Param("budgetid") budgetUUID, err := uuid.Parse(budgetID) if err != nil { @@ -30,7 +29,7 @@ func (h *Handler) budget(c *gin.Context) { } d := BudgetData{ - base, + c.MustGet("data").(AlwaysNeededData), transactions, } diff --git a/web/base.tpl b/web/base.tpl index c6eb3cb..b2cca49 100644 --- a/web/base.tpl +++ b/web/base.tpl @@ -20,7 +20,9 @@