CHANGE: added report section

This commit is contained in:
2025-02-26 15:05:50 +01:00
parent 0ddca8b9ce
commit 54104d5a0e
15 changed files with 376 additions and 96 deletions

View File

@@ -14,17 +14,22 @@ import (
// Frontend relevant backend functionality -> not used by the arduino devices
func TimeHandler(w http.ResponseWriter, r *http.Request) {
helper.RequiresLogin(Session, w, r)
helper.SetCors(w)
switch r.Method {
case "GET":
case http.MethodGet:
getBookings(w, r)
case "POST":
break
case http.MethodPost:
updateBooking(w, r)
case "OPTIONS":
break
case http.MethodOptions:
// just support options header for non GET Requests from SWAGGER
w.WriteHeader(http.StatusOK)
break
default:
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
http.Error(w, "Method not allowed!", http.StatusMethodNotAllowed)
break
}
}