mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-14 07:33:53 +02:00
fix:#30 updated files in pwa
This commit is contained in:
@@ -194,14 +194,14 @@ func AddRoutes(services serviceModel.Service) {
|
||||
})
|
||||
|
||||
// API Endpoint to get room occupancy for a time period for all rooms, when requested as BSON
|
||||
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
|
||||
services.App.OnBeforeServe().Add(func(e *core.ServeEvent) error {
|
||||
_, err := e.Router.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/schedule/rooms",
|
||||
Handler: func(c echo.Context) error {
|
||||
from := c.QueryParam("from")
|
||||
to := c.QueryParam("to")
|
||||
rooms, err := room.GetRoomOccupancyList(app, from, to, RoomOccupancyGranularity)
|
||||
rooms, err := room.GetRoomOccupancyList(services.App, from, to, RoomOccupancyGranularity)
|
||||
|
||||
if err != nil {
|
||||
slog.Error("Failed to get room occupancy: %v", "error", err)
|
||||
@@ -218,7 +218,7 @@ func AddRoutes(services serviceModel.Service) {
|
||||
return c.Blob(http.StatusOK, "application/bson", bson_coded)
|
||||
},
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.ActivityLogger(app),
|
||||
apis.ActivityLogger(services.App),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user