From 6fcf1893d32e3afe3aa8d9560e49442b1de8f49a Mon Sep 17 00:00:00 2001 From: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Date: Fri, 18 Apr 2025 17:34:34 -0300 Subject: [PATCH] fix(code): remove duplicated code BE-11821 (#667) --- api/http/middlewares/withitem.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/http/middlewares/withitem.go b/api/http/middlewares/withitem.go index 34e6a9ba2..fce95e86b 100644 --- a/api/http/middlewares/withitem.go +++ b/api/http/middlewares/withitem.go @@ -45,7 +45,7 @@ func WithItem[TId ~int, TObject any](getter ItemGetter[TId, TObject], idParam st } } -func FetchItem[T any](request *http.Request, contextKey string) (*T, error) { +func FetchItem[T any](request *http.Request, contextKey ItemContextKey) (*T, error) { contextData := request.Context().Value(contextKey) if contextData == nil { return nil, errors.New("unable to find item in request context")