From 5f967bcde18c98be1faabaeac358a722542ee138 Mon Sep 17 00:00:00 2001 From: Preston Baxter Date: Thu, 23 Nov 2023 12:16:11 -0600 Subject: [PATCH] fix bug in deletions --- ui/db/db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/db/db.go b/ui/db/db.go index e664134..03b475c 100644 --- a/ui/db/db.go +++ b/ui/db/db.go @@ -145,7 +145,7 @@ func deleteModels[T Model](db *DB, m ...T) error { return err } - if res.MatchedCount == 0 && res.ModifiedCount == 0 && res.UpsertedCount == 0 { + if res.DeletedCount == 0 { return errors.New("Failed to delete models properly") }