summaryrefslogtreecommitdiff
path: root/internal/handlers
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-03-29 14:28:41 +0300
committerGrail Finder <wohilas@gmail.com>2025-03-29 14:28:41 +0300
commitcb8b8e80d774608c6aa7a1d28f6d948828fea806 (patch)
treec6a6b99cb2f03b69d142930ca720c24f22b8351c /internal/handlers
parent7a3a73f2a7f2498c61c71f3242a0fcd6c56dfb69 (diff)
Chore: cleaning
Diffstat (limited to 'internal/handlers')
-rw-r--r--internal/handlers/main.go15
1 files changed, 0 insertions, 15 deletions
diff --git a/internal/handlers/main.go b/internal/handlers/main.go
index 86f5b09..4945db8 100644
--- a/internal/handlers/main.go
+++ b/internal/handlers/main.go
@@ -3,15 +3,12 @@ package handlers
import (
"demoon/config"
"demoon/internal/database/repos"
- "demoon/internal/models"
"html/template"
"log/slog"
"net/http"
"os"
)
-var defUS = models.UserScore{}
-
// Handlers structure
type Handlers struct {
cfg config.Config
@@ -45,17 +42,5 @@ func (h *Handlers) MainPage(w http.ResponseWriter, r *http.Request) {
abortWithError(w, err.Error())
return
}
- // get recommendations
- usernameRaw := r.Context().Value("username")
- h.log.Info("got mainpage request", "username", usernameRaw)
- if usernameRaw == nil {
- tmpl.ExecuteTemplate(w, "main", defUS)
- return
- }
- username := usernameRaw.(string)
- if username == "" {
- tmpl.ExecuteTemplate(w, "main", defUS)
- return
- }
tmpl.ExecuteTemplate(w, "main", nil)
}