Improve handling of context
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
@ -59,7 +58,7 @@ func (h *Handler) budgeting(c *gin.Context) {
|
||||
FromDate: firstOfMonth,
|
||||
ToDate: firstOfNextMonth,
|
||||
}
|
||||
categories, err := h.Service.DB.GetCategoriesWithBalance(context.Background(), params)
|
||||
categories, err := h.Service.DB.GetCategoriesWithBalance(c.Request.Context(), params)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user