Implement categories for new transactions
This commit is contained in:
@ -12,6 +12,7 @@ import (
|
||||
type AllAccountsData struct {
|
||||
AlwaysNeededData
|
||||
Account *postgres.Account
|
||||
Categories []postgres.GetCategoriesRow
|
||||
Transactions []postgres.GetTransactionsForBudgetRow
|
||||
}
|
||||
|
||||
@ -23,6 +24,12 @@ func (h *Handler) allAccounts(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
categories, err := h.Service.GetCategories(c.Request.Context(), budgetUUID)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusNotFound, err)
|
||||
return
|
||||
}
|
||||
|
||||
transactions, err := h.Service.GetTransactionsForBudget(c.Request.Context(), budgetUUID)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
@ -34,6 +41,7 @@ func (h *Handler) allAccounts(c *gin.Context) {
|
||||
&postgres.Account{
|
||||
Name: "All accounts",
|
||||
},
|
||||
categories,
|
||||
transactions,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user