diff --git a/internal/context/context.go b/internal/context/context.go index c0d289d..9886df0 100644 --- a/internal/context/context.go +++ b/internal/context/context.go @@ -42,10 +42,11 @@ func New(cfg *config.Config) *Context { // Handle gin route with context func (ctx *Context) API(handler func(ctx *Context)) func(*gin.Context) { - return func(c *gin.Context) { - ctx.Context = c - handler(ctx) + return func(gctx *gin.Context) { + context := Context{ + Context: gctx, + Config: ctx.Config, + } + handler(&context) } } - -// Todo: Check if this could cause a problem