updated tests
This commit is contained in:
@@ -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