Feat: roomlist & join room

This commit is contained in:
Grail Finder
2025-05-09 14:39:33 +03:00
parent 45761446e5
commit 6c9c86f02b
10 changed files with 141 additions and 10 deletions

View File

@ -1,6 +1,7 @@
package handlers
import (
"errors"
"golias/models"
"html/template"
"net/http"
@ -45,6 +46,12 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) {
abortWithError(w, err.Error())
return
}
// TODO: whos move it is?
if state.Role != "guesser" {
err = errors.New("need to guesser to open the card")
abortWithError(w, err.Error())
return
}
log.Debug("got state", "state", state)
// TODO: update room score
color, exists := roundWords[word]