chore: #123 unify metrics, logs, variable names and structure
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 46s
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 51s

This commit was merged in pull request #131.
This commit is contained in:
Tim
2024-09-02 22:44:59 +02:00
parent 6dfa09211a
commit 57893a4b85
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)