Improve sidebar template
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user