First Page

This commit is contained in:
Simon Martens
2025-02-10 20:44:34 +01:00
parent a39ac0d68e
commit deae787e2d
8 changed files with 292 additions and 4 deletions

26
cmd/resetpages.go Normal file
View File

@@ -0,0 +1,26 @@
package cmd
import (
"github.com/Theodor-Springmann-Stiftung/musenalm/app"
"github.com/pocketbase/pocketbase"
"github.com/pocketbase/pocketbase/core"
"github.com/spf13/cobra"
)
func AddResetPagesCommand(pb *pocketbase.PocketBase, app *app.App) *cobra.Command {
var resetPagesCmd = &cobra.Command{
Use: "resetpages",
Short: "Reset all pages",
Run: func(cmd *cobra.Command, args []string) {
pb.OnBootstrap().BindFunc(func(e *core.BootstrapEvent) error {
e.Next()
if err := app.ResetPages(); err != nil {
panic(err)
}
return nil
})
},
}
return resetPagesCmd
}