remove batch api in favor of custom endpoint for alerts management (#1039, #1023)

This commit is contained in:
henrygd
2025-08-19 20:56:12 -04:00
parent 37c6b920f9
commit 7ba1f366ba
13 changed files with 912 additions and 434 deletions

View File

@@ -6,9 +6,12 @@ package tests
import (
"beszel/internal/hub"
"fmt"
"testing"
"github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tests"
"github.com/stretchr/testify/assert"
_ "github.com/pocketbase/pocketbase/migrations"
)
@@ -86,3 +89,10 @@ func CreateRecord(app core.App, collectionName string, fields map[string]any) (*
return record, app.Save(record)
}
func ClearCollection(t testing.TB, app core.App, collectionName string) error {
_, err := app.DB().NewQuery(fmt.Sprintf("DELETE from %s", collectionName)).Execute()
recordCount, err := app.CountRecords(collectionName)
assert.EqualValues(t, recordCount, 0, "should have 0 records after clearing")
return err
}