fix:#28 fixed info panel and edited backend api for fix

This commit is contained in:
Elmar Kresse
2023-10-27 00:03:14 +02:00
parent c874cbed30
commit 090342736d
6 changed files with 27 additions and 23 deletions

View File

@@ -46,15 +46,15 @@ func GetAllModulesDistinct(app *pocketbase.PocketBase, c echo.Context) error {
// If the module does not exist, an error is returned
// If the module exists, the module is returned
// Module is a struct that exists in database as events
func GetModuleByName(app *pocketbase.PocketBase, name string) (model.Module, error) {
events, err := db.FindAllEventsByModule(app, name)
func GetModuleByName(app *pocketbase.PocketBase, module model.Module) (model.Module, error) {
events, err := db.FindAllEventsByModule(app, module)
if err != nil || len(events) == 0 {
return model.Module{}, err
} else {
return model.Module{
UUID: events[0].UUID,
Name: name,
Name: events[0].Name,
Events: events,
Prof: events[0].Prof,
Course: events[0].Course,