tested real proxmox connection
--> passed
This commit is contained in:
@@ -28,6 +28,9 @@ func (h Handler) ListTemplates(w http.ResponseWriter, r *http.Request) {
|
||||
writeError(w, http.StatusInternalServerError, "templates_list_failed")
|
||||
return
|
||||
}
|
||||
if templates == nil {
|
||||
templates = []Template{}
|
||||
}
|
||||
|
||||
writeJSON(w, http.StatusOK, map[string][]Template{"data": templates})
|
||||
}
|
||||
@@ -186,4 +189,4 @@ func writeJSON(w http.ResponseWriter, status int, body any) {
|
||||
|
||||
func writeError(w http.ResponseWriter, status int, message string) {
|
||||
writeJSON(w, status, map[string]string{"error": message})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user