aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_info.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:26:57 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:26:57 +0800
commit20b4fe0c59357a433042732d46e38da9c3d14c3b (patch)
tree537d7d450701a839802b1d57a82bd07324dcba90 /http_handle_repo_info.go
parentmisc: Move utils.go's string function to misc (diff)
downloadforge-20b4fe0c59357a433042732d46e38da9c3d14c3b.tar.gz
forge-20b4fe0c59357a433042732d46e38da9c3d14c3b.tar.zst
forge-20b4fe0c59357a433042732d46e38da9c3d14c3b.zip
database shall no longer be a global variable
Diffstat (limited to 'http_handle_repo_info.go')
-rw-r--r--http_handle_repo_info.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/http_handle_repo_info.go b/http_handle_repo_info.go
index 3f1787e..b7b7438 100644
--- a/http_handle_repo_info.go
+++ b/http_handle_repo_info.go
@@ -16,12 +16,12 @@ import (
// HTTP protocol.
//
// TODO: Reject access from web browsers.
-func httpHandleRepoInfo(writer http.ResponseWriter, request *http.Request, params map[string]any) (err error) {
+func (s *server) httpHandleRepoInfo(writer http.ResponseWriter, request *http.Request, params map[string]any) (err error) {
groupPath := params["group_path"].([]string)
repoName := params["repo_name"].(string)
var repoPath string
- if err := database.QueryRow(request.Context(), `
+ if err := s.database.QueryRow(request.Context(), `
WITH RECURSIVE group_path_cte AS (
-- Start: match the first name in the path where parent_group IS NULL
SELECT