From 01a128d9f93960599c0f20beb640b5b035015893 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 29 Mar 2025 14:44:03 +0300 Subject: feat: Add test question to main page template --- internal/handlers/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal') diff --git a/internal/handlers/main.go b/internal/handlers/main.go index 4945db8..3f2e1b2 100644 --- a/internal/handlers/main.go +++ b/internal/handlers/main.go @@ -3,6 +3,7 @@ package handlers import ( "demoon/config" "demoon/internal/database/repos" + "demoon/internal/models" "html/template" "log/slog" "net/http" @@ -42,5 +43,10 @@ func (h *Handlers) MainPage(w http.ResponseWriter, r *http.Request) { abortWithError(w, err.Error()) return } - tmpl.ExecuteTemplate(w, "main", nil) + testQuestion := &models.Question{ + Text: "___ du keine Zweifel daran?", + Options: []string{"Haben", "Hast", "Hat", "Habt"}, + CorrectIndex: 1, + } + tmpl.ExecuteTemplate(w, "main", testQuestion) } -- cgit v1.2.3