Add ability to edit payees

This commit is contained in:
2021-12-28 20:40:53 +00:00
parent 5018e5b973
commit 1a4267186a
5 changed files with 55 additions and 25 deletions

View File

@ -13,6 +13,7 @@ type TransactionData struct {
Transaction *postgres.Transaction
Account *postgres.Account
Categories []postgres.GetCategoriesRow
Payees []postgres.Payee
}
func (h *Handler) transaction(c *gin.Context) {
@ -43,11 +44,18 @@ func (h *Handler) transaction(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 := TransactionData{
data,
&transaction,
&account,
categories,
payees,
}
c.HTML(http.StatusOK, "transaction.html", d)