mirror of
https://codeberg.org/scip/anydb.git
synced 2026-02-04 17:30:57 +01:00
fix liniting bugs
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
//"github.com/alecthomas/repr"
|
||||
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"codeberg.org/scip/anydb/app"
|
||||
@@ -62,12 +63,16 @@ func RestList(resp http.ResponseWriter, req *http.Request, conf *cfg.Config) {
|
||||
|
||||
resp.Header().Set("Content-Type", "application/json")
|
||||
|
||||
json.NewEncoder(resp).Encode(
|
||||
err = json.NewEncoder(resp).Encode(
|
||||
ListResponse{
|
||||
Code: http.StatusOK,
|
||||
Success: true,
|
||||
Entries: entries,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func RestGet(resp http.ResponseWriter, req *http.Request, key string, conf *cfg.Config) {
|
||||
@@ -89,12 +94,16 @@ func RestGet(resp http.ResponseWriter, req *http.Request, key string, conf *cfg.
|
||||
|
||||
resp.Header().Set("Content-Type", "application/json")
|
||||
|
||||
json.NewEncoder(resp).Encode(
|
||||
err = json.NewEncoder(resp).Encode(
|
||||
SingleResponse{
|
||||
Code: http.StatusOK,
|
||||
Success: true,
|
||||
Entry: entry,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func RestDelete(resp http.ResponseWriter, req *http.Request, key string, conf *cfg.Config) {
|
||||
|
||||
Reference in New Issue
Block a user