fix status code 200 (#47818)

This commit is contained in:
ying-jeanne
2022-04-15 08:01:58 -04:00
committed by GitHub
parent f263cad8ab
commit 7ddae870e7
44 changed files with 166 additions and 152 deletions
+4 -4
View File
@@ -54,7 +54,7 @@ func (hs *HTTPServer) GetOrgByName(c *models.ReqContext) response.Response {
},
}
return response.JSON(200, &result)
return response.JSON(http.StatusOK, &result)
}
func (hs *HTTPServer) getOrgHelper(ctx context.Context, orgID int64) response.Response {
@@ -81,7 +81,7 @@ func (hs *HTTPServer) getOrgHelper(ctx context.Context, orgID int64) response.Re
},
}
return response.JSON(200, &result)
return response.JSON(http.StatusOK, &result)
}
// POST /api/orgs
@@ -105,7 +105,7 @@ func (hs *HTTPServer) CreateOrg(c *models.ReqContext) response.Response {
metrics.MApiOrgCreate.Inc()
return response.JSON(200, &util.DynMap{
return response.JSON(http.StatusOK, &util.DynMap{
"orgId": cmd.Result.Id,
"message": "Organization created",
})
@@ -226,5 +226,5 @@ func (hs *HTTPServer) SearchOrgs(c *models.ReqContext) response.Response {
return response.Error(500, "Failed to search orgs", err)
}
return response.JSON(200, query.Result)
return response.JSON(http.StatusOK, query.Result)
}