chore: #123 unify metrics, logs, variable names and structure
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 5s

This commit is contained in:
Tim
2024-09-02 22:44:59 +02:00
parent 6dfa09211a
commit 955ba59eb0
12 changed files with 83 additions and 113 deletions

View File

@@ -11,13 +11,13 @@ import (
func HandleIndexAnd404(db *sql.DB) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var comp templ.Component = nil
user_comp := UserInfoComp(verifySessionAndReturnUser(db, r))
userComp := UserInfoComp(verifySessionAndReturnUser(db, r))
if r.URL.Path != "/" {
comp = template.Layout(template.NotFound(), user_comp)
comp = template.Layout(template.NotFound(), userComp)
w.WriteHeader(http.StatusNotFound)
} else {
comp = template.Layout(template.Index(), user_comp)
comp = template.Layout(template.Index(), userComp)
}
comp.Render(r.Context(), w)