1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00

fix(code): remove duplicated code BE-11821 (#667)

This commit is contained in:
andres-portainer 2025-04-18 17:34:34 -03:00 committed by GitHub
parent 01afe34df7
commit 6fcf1893d3

View file

@ -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")