Actually use files
This commit is contained in:
@ -59,8 +59,7 @@ func (h *Handler) budgetingForMonth(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
firstOfNextMonth := firstOfMonth.AddDate(0, 1, 0)
|
||||
data, err := h.prepareBudgeting(c.Request.Context(), budget, firstOfNextMonth, firstOfMonth)
|
||||
data, err := h.prepareBudgeting(c.Request.Context(), budget, firstOfMonth)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
@ -68,7 +67,8 @@ func (h *Handler) budgetingForMonth(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, data)
|
||||
}
|
||||
|
||||
func (h *Handler) prepareBudgeting(ctx context.Context, budget postgres.Budget, firstOfNextMonth time.Time, firstOfMonth time.Time) (BudgetingForMonthResponse, error) {
|
||||
func (h *Handler) prepareBudgeting(ctx context.Context, budget postgres.Budget, firstOfMonth time.Time) (BudgetingForMonthResponse, error) {
|
||||
firstOfNextMonth := firstOfMonth.AddDate(0, 1, 0)
|
||||
categories, err := h.Service.GetCategories(ctx, budget.ID)
|
||||
if err != nil {
|
||||
return BudgetingForMonthResponse{}, fmt.Errorf("error loading categories: %w", err)
|
||||
|
Reference in New Issue
Block a user