From 71ab9b7f14118f02dd18cd733bd4e0ad19ece590 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 5 Apr 2025 20:21:32 +0800 Subject: config shall no longer be a global variable --- http_handle_index.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'http_handle_index.go') diff --git a/http_handle_index.go b/http_handle_index.go index 5d2dc3e..755e7c4 100644 --- a/http_handle_index.go +++ b/http_handle_index.go @@ -12,11 +12,11 @@ import ( // httpHandleIndex provides the main index page which includes a list of groups // and some global information such as SSH keys. -func httpHandleIndex(writer http.ResponseWriter, request *http.Request, params map[string]any) { +func (s *server) httpHandleIndex(writer http.ResponseWriter, request *http.Request, params map[string]any) { var err error var groups []nameDesc - groups, err = queryNameDesc(request.Context(), "SELECT name, COALESCE(description, '') FROM groups WHERE parent_group IS NULL") + groups, err = s.queryNameDesc(request.Context(), "SELECT name, COALESCE(description, '') FROM groups WHERE parent_group IS NULL") if err != nil { errorPage500(writer, params, "Error querying groups: "+err.Error()) return -- cgit v1.2.3