mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-03 10:19:14 +02:00
fixed db query and scheduled update process
This commit is contained in:
@@ -105,9 +105,17 @@ func UpdateModulesForCourse(app *pocketbase.PocketBase, course string) error {
|
||||
//get all events for the course and the semester
|
||||
events, err := db.GetAllModulesForCourse(app, course, "ws")
|
||||
if err != nil {
|
||||
return apis.NewNotFoundError("Events could not be found", err)
|
||||
return apis.NewNotFoundError("Events for winter semester could not be found", err)
|
||||
}
|
||||
|
||||
// append all events for the course and the semester to the events array for ss
|
||||
summerEvents, err := db.GetAllModulesForCourse(app, course, "ss")
|
||||
if err != nil {
|
||||
return apis.NewNotFoundError("Events for summer semester could not be found", err)
|
||||
}
|
||||
|
||||
events = append(events, summerEvents...)
|
||||
|
||||
//if there are no events in the database, save the new events
|
||||
if len(events) == 0 {
|
||||
_, dbError = db.SaveEvents(seminarGroups, collection, app)
|
||||
|
Reference in New Issue
Block a user