summaryrefslogtreecommitdiff
path: root/internal/handlers/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/main.go')
-rw-r--r--internal/handlers/main.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/handlers/main.go b/internal/handlers/main.go
index f0225f6..abd2226 100644
--- a/internal/handlers/main.go
+++ b/internal/handlers/main.go
@@ -135,7 +135,7 @@ func (h *Handlers) renderQuestion(w http.ResponseWriter, question *models.Questi
*models.Question
ShowNext bool
}
-
+
err = tmpl.ExecuteTemplate(w, "main", &TemplateData{
Question: question,
ShowNext: h.showNext,
@@ -143,8 +143,7 @@ func (h *Handlers) renderQuestion(w http.ResponseWriter, question *models.Questi
if err != nil {
h.log.Error("failed to render template", "error", err)
}
-}
- question, err := h.repo.DBGetQuestion("1")
+ question, err = h.repo.DBGetQuestion("1")
if err != nil {
h.log.Error("failed to get question", "error", err)
abortWithError(w, "Question not found")