fixed merge issue with main

This commit is contained in:
masterElmar
2023-11-01 19:06:54 +01:00
parent 765a18b215
commit b4afd85d5d
24 changed files with 1552 additions and 8 deletions

View File

@@ -107,6 +107,26 @@ func AddRoutes(app *pocketbase.PocketBase) {
})
// API Endpoint to create a new iCal feed
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
_, err := e.Router.AddRoute(echo.Route{
Method: http.MethodGet,
Path: "/api/schedule",
Handler: func(c echo.Context) error {
roomParam := c.QueryParam("room")
to := c.QueryParam("to")
from := c.QueryParam("from")
return room.GetRoomSchedule(c, app, roomParam, from, to)
},
Middlewares: []echo.MiddlewareFunc{
apis.ActivityLogger(app),
},
})
if err != nil {
return err
}
return nil
})
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
_, err := e.Router.AddRoute(echo.Route{
Method: http.MethodPost,