DustyP 9 months ago
parent acc1111550
commit 1cda34fe93

@ -13,6 +13,7 @@ import (
"encoding/pem" "encoding/pem"
"fmt" "fmt"
"io/fs" "io/fs"
"io/ioutil"
"log" "log"
"log/slog" "log/slog"
"math/big" "math/big"
@ -1817,6 +1818,17 @@ func (s *Server) handleRerunHeat() http.HandlerFunc {
// handleSetRacingGroup sets the currently racing group // handleSetRacingGroup sets the currently racing group
func (s *Server) handleSetRacingGroup() http.HandlerFunc { func (s *Server) handleSetRacingGroup() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
body, err := ioutil.ReadAll(r.Body)
if err != nil {
http.Error(w, "Failed to read request body", http.StatusBadRequest)
return
}
defer r.Body.Close()
// Process the plain text body
text := string(body)
s.logger.Info("Set racing group request", "text", text)
// Parse request body // Parse request body
var request struct { var request struct {
GroupID int64 `json:"group_id"` GroupID int64 `json:"group_id"`

Loading…
Cancel
Save