mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 01:05:32 +00:00
First Page
This commit is contained in:
26
cmd/resetpages.go
Normal file
26
cmd/resetpages.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user