fix:#16 added delete option and fixed uuid generation

This commit is contained in:
Elmar Kresse
2023-10-25 19:51:25 +02:00
parent 403e73cace
commit caa9415422
5 changed files with 107 additions and 4 deletions

View File

@@ -179,6 +179,17 @@ func DeleteAllEventsForCourse(app *pocketbase.PocketBase, course string, semeste
return nil
}
func DeleteAllEvents(app *pocketbase.PocketBase) error {
_, err := app.Dao().DB().Delete("events", dbx.NewExp("1=1")).Execute()
if err != nil {
return err
}
return nil
}
func FindAllEventsByModule(app *pocketbase.PocketBase, moduleName string) (model.Events, error) {
var events model.Events