[#5614] removed hook.HandlerFunc[T] type
This commit is contained in:
@@ -5,7 +5,7 @@ import "github.com/pocketbase/pocketbase/tools/hook"
|
||||
type Route[T hook.Resolver] struct {
|
||||
excludedMiddlewares map[string]struct{}
|
||||
|
||||
Action hook.HandlerFunc[T]
|
||||
Action func(T) error
|
||||
Method string
|
||||
Path string
|
||||
Middlewares []*hook.Handler[T]
|
||||
@@ -18,7 +18,7 @@ type Route[T hook.Resolver] struct {
|
||||
//
|
||||
// If you need to specify a named middleware (ex. so that it can be removed)
|
||||
// or middleware with custom exec prirority, use the [Bind] method.
|
||||
func (route *Route[T]) BindFunc(middlewareFuncs ...hook.HandlerFunc[T]) *Route[T] {
|
||||
func (route *Route[T]) BindFunc(middlewareFuncs ...func(T) error) *Route[T] {
|
||||
for _, m := range middlewareFuncs {
|
||||
route.Middlewares = append(route.Middlewares, &hook.Handler[T]{Func: m})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user