create-categories #79

Open
jacob1123 wants to merge 31 commits from create-categories into master
2 changed files with 4 additions and 4 deletions
Showing only changes of commit fc15d8b56e - Show all commits

View File

@ -23,7 +23,7 @@ func (h *Handler) newCategoryGroup(c echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, "category group is required")
}
budget, err := h.Service.CreateCategoryGroup(c.Request().Context(), postgres.CreateCategoryGroupParams{
categoryGroup, err := h.Service.CreateCategoryGroup(c.Request().Context(), postgres.CreateCategoryGroupParams{
BudgetID: newCategory.BudgetID,
Name: newCategory.Group,
})
@ -31,5 +31,5 @@ func (h *Handler) newCategoryGroup(c echo.Context) error {
return err
}
return c.JSON(http.StatusOK, budget)
return c.JSON(http.StatusOK, categoryGroup)
}

View File

@ -36,7 +36,7 @@ func (h *Handler) newCategory(c echo.Context) error {
return err
}
budget, err := h.Service.CreateCategory(c.Request().Context(), postgres.CreateCategoryParams{
category, err := h.Service.CreateCategory(c.Request().Context(), postgres.CreateCategoryParams{
CategoryGroupID: categoryGroup.ID,
Name: newCategory.Name,
})
@ -44,5 +44,5 @@ func (h *Handler) newCategory(c echo.Context) error {
return err
}
return c.JSON(http.StatusOK, budget)
return c.JSON(http.StatusOK, category)
}