mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
fix(code): remove duplicated code BE-11821 (#667)
This commit is contained in:
parent
01afe34df7
commit
6fcf1893d3
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
contextData := request.Context().Value(contextKey)
|
||||||
if contextData == nil {
|
if contextData == nil {
|
||||||
return nil, errors.New("unable to find item in request context")
|
return nil, errors.New("unable to find item in request context")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue