Use same template for account and all-accounts
This commit is contained in:
@ -9,12 +9,13 @@ import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type BudgetData struct {
|
||||
type AllAccountsData struct {
|
||||
AlwaysNeededData
|
||||
Account *postgres.Account
|
||||
Transactions []postgres.GetTransactionsForBudgetRow
|
||||
}
|
||||
|
||||
func (h *Handler) budget(c *gin.Context) {
|
||||
func (h *Handler) allAccounts(c *gin.Context) {
|
||||
budgetID := c.Param("budgetid")
|
||||
budgetUUID, err := uuid.Parse(budgetID)
|
||||
if err != nil {
|
||||
@ -28,12 +29,15 @@ func (h *Handler) budget(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
d := BudgetData{
|
||||
d := AllAccountsData{
|
||||
c.MustGet("data").(AlwaysNeededData),
|
||||
&postgres.Account{
|
||||
Name: "All accounts",
|
||||
},
|
||||
transactions,
|
||||
}
|
||||
|
||||
c.HTML(http.StatusOK, "budget.html", d)
|
||||
c.HTML(http.StatusOK, "account.html", d)
|
||||
}
|
||||
|
||||
func (h *Handler) newBudget(c *gin.Context) {
|
||||
|
Reference in New Issue
Block a user