feat:#150 added slog for more functions and improved return signature

This commit is contained in:
Elmar Kresse
2024-01-22 12:17:53 +01:00
parent 95a256929d
commit 70170054e8
4 changed files with 48 additions and 19 deletions

View File

@@ -49,7 +49,11 @@ func AddRoutes(app *pocketbase.PocketBase) {
Method: http.MethodGet,
Path: "/api/fetch/groups",
Handler: func(c echo.Context) error {
return v1.SeminarGroups(c, app)
groups, err := v1.FetchSeminarGroups(app)
if err != nil {
return c.JSON(http.StatusInternalServerError, "Failed to fetch seminar groups")
}
return c.JSON(http.StatusOK, groups)
},
Middlewares: []echo.MiddlewareFunc{
apis.ActivityLogger(app),