mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-07 20:47:25 +01:00
added explicit errors when trying to truncate view collections or deleting view records
This commit is contained in:
1 parent
2c2246ecb9
commit
c09cd8364a
7 files changed
+61
-4
No files matched your search
@@ -299,6 +299,18 @@ func TestFindCollectionTruncate(t *testing.T) {
|
||||
return len(entries), err
|
||||
}
|
||||
|
||||
t.Run("truncate view", func(t *testing.T) {
|
||||
view2, err := app.FindCollectionByNameOrId("view2")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
err = app.TruncateCollection(view2)
|
||||
if err == nil {
|
||||
t.Fatalf("Expected truncate to fail because view collections can't be truncated")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("truncate failure", func(t *testing.T) {
|
||||
demo3, err := app.FindCollectionByNameOrId("demo3")
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user