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
+5 -5
View File
@@ -64,7 +64,7 @@ func (hs *HTTPServer) addOrgUserHelper(ctx context.Context, cmd models.AddOrgUse
return response.Error(500, "Could not add user to organization", err)
}
return response.JSON(200, util.DynMap{
return response.JSON(http.StatusOK, util.DynMap{
"message": "User added to organization",
"userId": cmd.UserId,
})
@@ -83,7 +83,7 @@ func (hs *HTTPServer) GetOrgUsersForCurrentOrg(c *models.ReqContext) response.Re
return response.Error(500, "Failed to get users for current organization", err)
}
return response.JSON(200, result)
return response.JSON(http.StatusOK, result)
}
// GET /api/org/users/lookup
@@ -109,7 +109,7 @@ func (hs *HTTPServer) GetOrgUsersForCurrentOrgLookup(c *models.ReqContext) respo
})
}
return response.JSON(200, result)
return response.JSON(http.StatusOK, result)
}
// GET /api/orgs/:orgId/users
@@ -130,7 +130,7 @@ func (hs *HTTPServer) GetOrgUsers(c *models.ReqContext) response.Response {
return response.Error(500, "Failed to get users for organization", err)
}
return response.JSON(200, result)
return response.JSON(http.StatusOK, result)
}
func (hs *HTTPServer) getOrgUsersHelper(c *models.ReqContext, query *models.GetOrgUsersQuery, signedInUser *models.SignedInUser) ([]*models.OrgUserDTO, error) {
@@ -201,7 +201,7 @@ func (hs *HTTPServer) SearchOrgUsersWithPaging(c *models.ReqContext) response.Re
query.Result.Page = page
query.Result.PerPage = perPage
return response.JSON(200, query.Result)
return response.JSON(http.StatusOK, query.Result)
}
// PATCH /api/org/users/:userId