Improve handling of context
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"git.javil.eu/jacob1123/budgeteer/postgres"
|
||||
@ -23,7 +22,7 @@ func (h *Handler) getImportantData(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
budget, err := h.Service.DB.GetBudget(context.Background(), budgetUUID)
|
||||
budget, err := h.Service.DB.GetBudget(c.Request.Context(), budgetUUID)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusNotFound, err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user