Skip to content

Commit

Permalink
handlers.nextQuestion: return HTTP Status no content
Browse files Browse the repository at this point in the history
Also remove debug print
  • Loading branch information
vojta001 committed Apr 1, 2021
1 parent bdcbb8c commit de28e7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/web/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ func (app *application) nextQuestion(w http.ResponseWriter, r *http.Request, par
if err := app.model.NextQuestion(sessionId, time.Now(), r.Context()); err == nil {
if su, err := app.model.GetQuestionStateUpdate(sessionId, r.Context()); err == nil {
app.rtClients.SendToAll(sessionId, su)
w.WriteHeader(http.StatusNoContent)
return
} else {
app.serverError(w, err)
return
Expand All @@ -151,7 +153,6 @@ func (app *application) nextQuestion(w http.ResponseWriter, r *http.Request, par
return
}
} else if ent.IsNotFound(err) {
app.infoLog.Println(playerUid)
app.clientError(w, http.StatusNotFound)
return
} else {
Expand Down

0 comments on commit de28e7a

Please sign in to comment.