From cc58c0d012d9b45ee5f28e2530b67e404829e7a5 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Mon, 10 Jan 2022 10:15:55 +0000 Subject: [PATCH] Add row to create new transaction --- http/account.go | 8 ++++++++ web/account.html | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/http/account.go b/http/account.go index ecfc409..3951868 100644 --- a/http/account.go +++ b/http/account.go @@ -13,6 +13,7 @@ type AccountData struct { Account *postgres.Account Categories []postgres.GetCategoriesRow Transactions []postgres.GetTransactionsForAccountRow + Payees []postgres.Payee } func (h *Handler) account(c *gin.Context) { @@ -43,11 +44,18 @@ func (h *Handler) account(c *gin.Context) { return } + payees, err := h.Service.GetPayees(c.Request.Context(), data.Budget.ID) + if err != nil { + c.AbortWithError(http.StatusNotFound, err) + return + } + d := AccountData{ data, &account, categories, transactions, + payees, } c.HTML(http.StatusOK, "account.html", d) diff --git a/web/account.html b/web/account.html index b3af46f..da2755d 100644 --- a/web/account.html +++ b/web/account.html @@ -12,6 +12,41 @@ + + + + + + + + + {{range .Transactions}} -- 2.47.2
+ + + + {{.Account.Name}} + + + + + {{range .Payees}} + + {{- end}} + + + + + + {{range .Categories}} + + {{- end}} + + + + + + +
{{.Date.Format "02.01.2006"}}