From 0a4bfe6ece1a33fbf6b0d972d0afd3a0231f81bc Mon Sep 17 00:00:00 2001 From: "Grail Finder (aider)" Date: Sat, 5 Apr 2025 16:37:38 +0300 Subject: fix: properly define MainPage handler method --- internal/handlers/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) } -- cgit v1.2.3