mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-11 16:57:26 +02:00
updated tests
This commit is contained in:
1 parent
5dbf975424
commit
dbc074ee9a
2 files changed
+27
-8
No files matched your search
+3
-3
@@ -141,7 +141,7 @@ func (app *BaseApp) delete(ctx context.Context, model Model, isForAuxDB bool) er
|
||||
})
|
||||
if deleteErr != nil {
|
||||
errEvent := &ModelErrorEvent{ModelEvent: *event, Error: deleteErr}
|
||||
errEvent.App = app
|
||||
errEvent.App = app // replace with the initial app in case it was changed by the hook
|
||||
hookErr := app.OnModelAfterDeleteError().Trigger(errEvent)
|
||||
if hookErr != nil {
|
||||
return errors.Join(deleteErr, hookErr)
|
||||
@@ -332,7 +332,7 @@ func (app *BaseApp) create(ctx context.Context, model Model, withValidations boo
|
||||
event.Model.MarkAsNew() // reset "new" state
|
||||
|
||||
errEvent := &ModelErrorEvent{ModelEvent: *event, Error: saveErr}
|
||||
errEvent.App = app
|
||||
errEvent.App = app // replace with the initial app in case it was changed by the hook
|
||||
hookErr := app.OnModelAfterCreateError().Trigger(errEvent)
|
||||
if hookErr != nil {
|
||||
return errors.Join(saveErr, hookErr)
|
||||
@@ -416,7 +416,7 @@ func (app *BaseApp) update(ctx context.Context, model Model, withValidations boo
|
||||
})
|
||||
if saveErr != nil {
|
||||
errEvent := &ModelErrorEvent{ModelEvent: *event, Error: saveErr}
|
||||
errEvent.App = app
|
||||
errEvent.App = app // replace with the initial app in case it was changed by the hook
|
||||
hookErr := app.OnModelAfterUpdateError().Trigger(errEvent)
|
||||
if hookErr != nil {
|
||||
return errors.Join(saveErr, hookErr)
|
||||
|
||||
Reference in new issue
Block a user