1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-11-30 17:15:36 +02:00

added default hook handler arg name and router search helper

This commit is contained in:
Gani Georgiev
2024-10-13 13:25:04 +03:00
parent 3e0869a30b
commit ff3f4332ce
4 changed files with 12 additions and 2 deletions

View File

@@ -73,7 +73,7 @@ func (h *TaggedHook[T]) Bind(handler *Handler[T]) string {
//
// It is similar to [Hook.Bind] with the difference that the handler
// function is invoked only if the event data tags satisfy h.CanTriggerOn.
func (h *TaggedHook[T]) BindFunc(fn func(T) error) string {
func (h *TaggedHook[T]) BindFunc(fn func(e T) error) string {
return h.mainHook.BindFunc(func(e T) error {
if h.CanTriggerOn(e.Tags()) {
return fn(e)