added api for room and day check

This commit is contained in:
Elmar Kresse
2023-09-21 01:29:55 +02:00
parent 89fa8d682a
commit 47adb18359
3 changed files with 36 additions and 0 deletions

View File

@@ -71,6 +71,25 @@ func AddRoutes(app *pocketbase.PocketBase) {
return nil
})
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
_, err := e.Router.AddRoute(echo.Route{
Method: http.MethodGet,
Path: "/api/schedule/day",
Handler: func(c echo.Context) error {
roomParam := c.QueryParam("room")
date := c.QueryParam("date")
return room.GetRoomScheduleForDay(c, app, roomParam, date)
},
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,