adds dedup command

This commit is contained in:
Christian Beutel
2025-09-13 13:27:23 +02:00
parent 24908993fa
commit 962fddc1e2
2 changed files with 128 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ import (
"github.com/pocketbase/pocketbase/tools/security"
"github.com/spf13/cast"
"pocketbase/commands"
"pocketbase/federation"
"pocketbase/integrations/komoot"
"pocketbase/integrations/strava"
@@ -73,6 +74,8 @@ func main() {
registerMigrations(app)
setupEventHandlers(app, client)
setupCommands(app)
if err := app.Start(); err != nil {
log.Fatal(err)
}
@@ -140,6 +143,10 @@ func setupEventHandlers(app *pocketbase.PocketBase, client meilisearch.ServiceMa
app.OnBootstrap().BindFunc(onBootstrapHandler())
}
func setupCommands(app *pocketbase.PocketBase) {
app.RootCmd.AddCommand(commands.Dedup(app))
}
func sanitizeHTML() func(e *core.RecordRequestEvent) error {
return func(e *core.RecordRequestEvent) error {
fieldsToSanitize := map[string][]string{