mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-02 09:49:13 +02:00
added api for room and day check
This commit is contained in:
@@ -118,6 +118,18 @@ func GetRooms(app *pocketbase.PocketBase) []string {
|
||||
return roomArray
|
||||
}
|
||||
|
||||
func GetRoomScheduleForDay(app *pocketbase.PocketBase, room string, date string) []model.Event {
|
||||
var events []model.Event
|
||||
|
||||
// get all events from event records in the events collection
|
||||
err := app.Dao().DB().Select("*").From("events").Where(dbx.Like("Rooms", room)).AndWhere(dbx.Like("Start", date)).All(&events)
|
||||
if err != nil {
|
||||
print("Error while getting events from database: ", err)
|
||||
return nil
|
||||
}
|
||||
return events
|
||||
}
|
||||
|
||||
type Events []*model.Event
|
||||
|
||||
// EmitICal implements the interface for goics
|
||||
|
Reference in New Issue
Block a user