blob: 4632526ed5fcd102e51d8cbb5a7252fa4cef1959 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-FileContributor: Runxi Yu <https://runxiyu.org>
package main
import (
"net/http"
)
func handle_index(w http.ResponseWriter, r *http.Request, params map[string]any) {
var err error
var groups []name_desc_t
groups, err = query_name_desc_list(r.Context(), "SELECT name, COALESCE(description, '') FROM groups WHERE parent_group IS NULL")
if err != nil {
http.Error(w, "Error querying groups: "+err.Error(), http.StatusInternalServerError)
return
}
params["groups"] = groups
render_template(w, "index", params)
}
|