Implement POST /users/search endpoint for APIv4 (#5822)
* Implement POST /users/search endpoint for APIv4 * PLT-2713 Added store functions for searching users that don't have a team * PLT-2713 Added 'without_team' option when searching users * PLT-2713 Added 'without_team' option when searching users (v4)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
7e2e823884
Коммит
2a753949f1
16
api/user.go
16
api/user.go
@@ -1535,22 +1535,12 @@ func searchUsers(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
var profiles []*model.User
|
||||
var err *model.AppError
|
||||
if props.InChannelId != "" {
|
||||
profiles, err = app.SearchUsersInChannel(props.InChannelId, props.Term, searchOptions, c.IsSystemAdmin())
|
||||
} else if props.NotInChannelId != "" {
|
||||
profiles, err = app.SearchUsersNotInChannel(props.TeamId, props.NotInChannelId, props.Term, searchOptions, c.IsSystemAdmin())
|
||||
} else {
|
||||
profiles, err = app.SearchUsersInTeam(props.TeamId, props.Term, searchOptions, c.IsSystemAdmin())
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
if profiles, err := app.SearchUsers(props, searchOptions, c.IsSystemAdmin()); err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
} else {
|
||||
w.Write([]byte(model.UserListToJson(profiles)))
|
||||
}
|
||||
|
||||
w.Write([]byte(model.UserListToJson(profiles)))
|
||||
}
|
||||
|
||||
func getProfilesByIds(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Ссылка в новой задаче
Block a user