mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-02 17:59:14 +02:00
feat:#74 added security and refactored api endpoint
This commit is contained in:
@@ -42,11 +42,8 @@ func GetAllModulesDistinct(app *pocketbase.PocketBase, c echo.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
// GetModuleByName returns a module by its name
|
||||
// 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, module model.Module) (model.Module, error) {
|
||||
func GetModuleByUUID(app *pocketbase.PocketBase, uuid string) (model.Module, error) {
|
||||
module, err := db.FindModuleByUUID(app, uuid)
|
||||
events, err := db.FindAllEventsByModule(app, module)
|
||||
|
||||
if err != nil || len(events) == 0 {
|
||||
|
Reference in New Issue
Block a user