feat:#39 added fetcher for Events

This commit is contained in:
Elmar Kresse
2024-03-23 19:55:27 +01:00
parent 48a8eb43c3
commit 38f9c4d71b
10 changed files with 359 additions and 187 deletions

View File

@@ -69,10 +69,11 @@ func AddRoutes(app *pocketbase.PocketBase) {
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
_, err := e.Router.AddRoute(echo.Route{
Method: http.MethodGet,
Path: "/api/fetch/v3/groups",
Path: "/api/fetch/v3",
Handler: func(c echo.Context) error {
groups, err := v3.FetchSeminarGroups(app)
groups, err := v3.FetchAllResources(app)
if err != nil {
slog.Error("Failed to fetch seminar groups: %v", err)
return c.JSON(http.StatusBadRequest, "Failed to fetch seminar groups")
}
return c.JSON(http.StatusOK, groups)