Files
htwkalender-pwa/backend/service/room/roomService.go
2023-11-01 19:06:54 +01:00

24 lines
664 B
Go

package room
import (
"github.com/labstack/echo/v5"
"github.com/pocketbase/pocketbase"
"htwkalender/service/db"
"net/http"
)
func GetRooms(c echo.Context, app *pocketbase.PocketBase) error {
rooms := db.GetRooms(app)
return c.JSON(http.StatusOK, rooms)
}
func GetRoomScheduleForDay(c echo.Context, app *pocketbase.PocketBase, room string, date string) error {
events := db.GetRoomScheduleForDay(app, room, date)
return c.JSON(http.StatusOK, events)
}
func GetRoomSchedule(c echo.Context, app *pocketbase.PocketBase, room string, from string, to string) error {
events := db.GetRoomSchedule(app, room, from, to)
return c.JSON(http.StatusOK, events)
}