Chore: Move SearchOrgs to org service (#55416)
* Chore: Move SearchOrgs to org service * Fix lint * Fix lint 2
This commit is contained in:
+4
-3
@@ -320,18 +320,19 @@ func (hs *HTTPServer) SearchOrgs(c *models.ReqContext) response.Response {
|
||||
|
||||
page := c.QueryInt("page")
|
||||
|
||||
query := models.SearchOrgsQuery{
|
||||
query := org.SearchOrgsQuery{
|
||||
Query: c.Query("query"),
|
||||
Name: c.Query("name"),
|
||||
Page: page,
|
||||
Limit: perPage,
|
||||
}
|
||||
|
||||
if err := hs.SQLStore.SearchOrgs(c.Req.Context(), &query); err != nil {
|
||||
result, err := hs.orgService.Search(c.Req.Context(), &query)
|
||||
if err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to search orgs", err)
|
||||
}
|
||||
|
||||
return response.JSON(http.StatusOK, query.Result)
|
||||
return response.JSON(http.StatusOK, result)
|
||||
}
|
||||
|
||||
// swagger:parameters updateCurrentOrgAddress
|
||||
|
||||
Reference in New Issue
Block a user