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

added realtime api record resolve tests

This commit is contained in:
Gani Georgiev
2025-02-09 23:26:25 +02:00
parent f767af0ded
commit 2a1fdc1613
2 changed files with 247 additions and 2 deletions

View File

@@ -116,8 +116,7 @@ func (app *BaseApp) delete(ctx context.Context, model Model, isForAuxDB bool) er
deleteErr := app.OnModelDelete().Trigger(event, func(e *ModelEvent) error {
pk := cast.ToString(e.Model.LastSavedPK())
if cast.ToString(pk) == "" {
if pk == "" {
return errors.New("the model can be deleted only if it is existing and has a non-empty primary key")
}