diff --git a/api/init.go b/api/init.go index 0b8b4cea..01779306 100644 --- a/api/init.go +++ b/api/init.go @@ -55,5 +55,5 @@ func Init(cfg *config.AppConfig) { ui.HandleUIMethod(api.POST, pathPrefix + "system/cluster", shdl.HandleCreateClusterAction) ui.HandleUIMethod(api.PUT, pathPrefix + "system/cluster/:id", shdl.HandleUpdateClusterAction) ui.HandleUIMethod(api.DELETE, pathPrefix + "system/cluster/:id", shdl.HandleDeleteClusterAction) - ui.HandleUIMethod(api.GET, pathPrefix + "system/cluster", shdl.HandleSearchClusterAction) + ui.HandleUIMethod(api.GET, pathPrefix + "system/cluster/_search", shdl.HandleSearchClusterAction) } diff --git a/api/system/cluster_config.go b/api/system/cluster_config.go index 24044bd5..49fe2a8b 100644 --- a/api/system/cluster_config.go +++ b/api/system/cluster_config.go @@ -137,7 +137,7 @@ func (h *APIHandler) HandleSearchClusterAction(w http.ResponseWriter, req *http. res, err := esClient.SearchWithRawQueryDSL(orm.GetIndexName(model.ClusterConfig{}), []byte(queryDSL)) if err != nil { resBody["error"] = err.Error() - h.WriteJSON(w, resBody, http.StatusOK) + h.WriteJSON(w, resBody, http.StatusInternalServerError) return }