Add in context to dashboard for user to topbar loads all items & refactor for clarity of variable extraction.

This commit is contained in:
2025-04-23 15:29:34 +01:00
parent b5f1b17684
commit 0634876b75
8 changed files with 47 additions and 30 deletions

View File

@@ -16,7 +16,8 @@ import (
func AdminTriggersHandler(db *sql.DB) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
context := templateHelpers.TemplateContext(w, r, models.TemplateData{})
data := models.TemplateData{}
context := templateHelpers.TemplateContext(w, r, data)
if flash := r.URL.Query().Get("flash"); flash != "" {
context["Flash"] = flash