Enha: state to hold room_id instead of whole room

This commit is contained in:
Grail Finder
2025-05-08 10:25:38 +03:00
parent 3ade7310a7
commit b20f7ac6b7
12 changed files with 110 additions and 35 deletions

View File

@ -79,3 +79,26 @@ func HandleRoomEnter(w http.ResponseWriter, r *http.Request) {
}
tmpl.ExecuteTemplate(w, "base", room)
}
func HandleJoinTeam(w http.ResponseWriter, r *http.Request) {
// parse payload
team := r.URL.Query().Get("team")
role := r.URL.Query().Get("role")
if team == "" || role == "" {
msg := "missing team or role"
log.Error(msg)
abortWithError(w, msg)
// error
return
}
// get username
// get state
// get room
// return html
tmpl, err := template.ParseGlob("components/*.html")
if err != nil {
abortWithError(w, err.Error())
return
}
tmpl.ExecuteTemplate(w, "base", nil)
}