parent
af1fd56d8a
commit
3ac1f35349
|
@ -106,6 +106,7 @@ func GetAllOrgs(ctx *context.APIContext) {
|
||||||
listOptions := utils.GetListOptions(ctx)
|
listOptions := utils.GetListOptions(ctx)
|
||||||
|
|
||||||
users, maxResults, err := models.SearchUsers(&models.SearchUserOptions{
|
users, maxResults, err := models.SearchUsers(&models.SearchUserOptions{
|
||||||
|
Actor: ctx.User,
|
||||||
Type: models.UserTypeOrganization,
|
Type: models.UserTypeOrganization,
|
||||||
OrderBy: models.SearchOrderByAlphabetically,
|
OrderBy: models.SearchOrderByAlphabetically,
|
||||||
ListOptions: listOptions,
|
ListOptions: listOptions,
|
||||||
|
|
|
@ -130,6 +130,7 @@ func GetAll(ctx *context.APIContext) {
|
||||||
listOptions := utils.GetListOptions(ctx)
|
listOptions := utils.GetListOptions(ctx)
|
||||||
|
|
||||||
publicOrgs, maxResults, err := models.SearchUsers(&models.SearchUserOptions{
|
publicOrgs, maxResults, err := models.SearchUsers(&models.SearchUserOptions{
|
||||||
|
Actor: ctx.User,
|
||||||
ListOptions: listOptions,
|
ListOptions: listOptions,
|
||||||
Type: models.UserTypeOrganization,
|
Type: models.UserTypeOrganization,
|
||||||
OrderBy: models.SearchOrderByAlphabetically,
|
OrderBy: models.SearchOrderByAlphabetically,
|
||||||
|
|
|
@ -56,15 +56,13 @@ func Search(ctx *context.APIContext) {
|
||||||
|
|
||||||
listOptions := utils.GetListOptions(ctx)
|
listOptions := utils.GetListOptions(ctx)
|
||||||
|
|
||||||
opts := &models.SearchUserOptions{
|
users, maxResults, err := models.SearchUsers(&models.SearchUserOptions{
|
||||||
Actor: ctx.User,
|
Actor: ctx.User,
|
||||||
Keyword: strings.Trim(ctx.Query("q"), " "),
|
Keyword: strings.Trim(ctx.Query("q"), " "),
|
||||||
UID: ctx.QueryInt64("uid"),
|
UID: ctx.QueryInt64("uid"),
|
||||||
Type: models.UserTypeIndividual,
|
Type: models.UserTypeIndividual,
|
||||||
ListOptions: listOptions,
|
ListOptions: listOptions,
|
||||||
}
|
})
|
||||||
|
|
||||||
users, maxResults, err := models.SearchUsers(opts)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{
|
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{
|
||||||
"ok": false,
|
"ok": false,
|
||||||
|
|
Loading…
Reference in New Issue