mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-07 04:09:17 +02:00
[#10] Move to new endpoint (room schedule for given duration)
This commit is contained in:
@@ -93,11 +93,12 @@ func AddRoutes(app *pocketbase.PocketBase) {
|
||||
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
|
||||
_, err := e.Router.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/schedule/week",
|
||||
Path: "/api/schedule",
|
||||
Handler: func(c echo.Context) error {
|
||||
roomParam := c.QueryParam("room")
|
||||
week := c.QueryParam("week")
|
||||
return room.GetRoomScheduleForWeek(c, app, roomParam, week)
|
||||
to := c.QueryParam("to")
|
||||
from := c.QueryParam("from")
|
||||
return room.GetRoomSchedule(c, app, roomParam, from, to)
|
||||
},
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.ActivityLogger(app),
|
||||
|
Reference in New Issue
Block a user