fix:#30 updated files in pwa

This commit is contained in:
Elmar Kresse
2024-07-24 14:13:28 +02:00
parent b7b996ffdf
commit be1300d221
17 changed files with 4280 additions and 630 deletions

View File

@@ -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 {