1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-12-01 01:16:08 +02:00

added support for optional Model and Record event hook tags

This commit is contained in:
Gani Georgiev
2023-01-27 22:19:08 +02:00
parent 32af49dbec
commit b8d7609e9e
20 changed files with 748 additions and 559 deletions

View File

@@ -71,10 +71,9 @@ func InitApi(app core.App) (*echo.Echo, error) {
apiErr = NewBadRequestError("", err)
}
event := &core.ApiErrorEvent{
HttpContext: c,
Error: apiErr,
}
event := new(core.ApiErrorEvent)
event.HttpContext = c
event.Error = apiErr
// send error response
hookErr := app.OnBeforeApiError().Trigger(event, func(e *core.ApiErrorEvent) error {