aboutsummaryrefslogtreecommitdiff
path: root/http_handle_index.go
diff options
context:
space:
mode:
Diffstat (limited to 'http_handle_index.go')
-rw-r--r--http_handle_index.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/http_handle_index.go b/http_handle_index.go
index bf36f98..4448272 100644
--- a/http_handle_index.go
+++ b/http_handle_index.go
@@ -4,10 +4,7 @@ import (
"net/http"
)
-func handle_index(w http.ResponseWriter, r *http.Request) {
- data := make(map[string]any)
- data["global"] = global_data
-
+func handle_index(w http.ResponseWriter, r *http.Request, params map[string]any) {
rows, err := database.Query(r.Context(), "SELECT name FROM groups")
if err != nil {
_, _ = w.Write([]byte("Error querying groups: " + err.Error()))
@@ -30,9 +27,9 @@ func handle_index(w http.ResponseWriter, r *http.Request) {
return
}
- data["groups"] = groups
+ params["groups"] = groups
- err = templates.ExecuteTemplate(w, "index", data)
+ err = templates.ExecuteTemplate(w, "index", params)
if err != nil {
_, _ = w.Write([]byte("Error rendering template: " + err.Error()))
return