chore: #123 unify metrics, logs, variable names and structure

This commit is contained in:
2024-09-02 22:44:59 +02:00
parent b548968ac6
commit 9666f239fe
13 changed files with 84 additions and 114 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)