missing returns

master
Jason Staten 2 years ago
parent c50d78450e
commit aeb4c6a780

@ -95,11 +95,13 @@ func (s *server) HandleToggle() http.HandlerFunc {
if err != nil {
http.Error(w, "Bad id", http.StatusBadRequest)
return
}
err = s.db.ToggleTodo(id)
if err != nil {
http.Error(w, "failed to toggle", http.StatusInternalServerError)
return
}
http.Redirect(w, r, "/", http.StatusSeeOther)

Loading…
Cancel
Save