diff options
-rw-r--r-- | internal/handlers/main.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/handlers/main.go b/internal/handlers/main.go index edda1bf..f0225f6 100644 --- a/internal/handlers/main.go +++ b/internal/handlers/main.go @@ -151,6 +151,16 @@ func (h *Handlers) renderQuestion(w http.ResponseWriter, question *models.Questi return } +} + +func (h *Handlers) MainPage(w http.ResponseWriter, r *http.Request) { + question, err := h.repo.DBGetQuestion("1") + if err != nil { + h.log.Error("failed to get question", "error", err) + abortWithError(w, "Question not found") + return + } + h.showNext = false h.renderQuestion(w, question) } |