diff options
Diffstat (limited to 'api4/user.go')
-rw-r--r-- | api4/user.go | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/api4/user.go b/api4/user.go index 9aa709db5..f5c56656c 100644 --- a/api4/user.go +++ b/api4/user.go @@ -508,7 +508,12 @@ func autocompleteUsers(c *Context, w http.ResponseWriter, r *http.Request) { return } - result, _ := c.App.AutocompleteUsersInChannel(teamId, channelId, name, searchOptions, c.IsSystemAdmin()) + result, err := c.App.AutocompleteUsersInChannel(teamId, channelId, name, searchOptions, c.IsSystemAdmin()) + if err != nil { + c.Err = err + return + } + autocomplete.Users = result.InChannel autocomplete.OutOfChannel = result.OutOfChannel } else if len(teamId) > 0 { @@ -517,11 +522,20 @@ func autocompleteUsers(c *Context, w http.ResponseWriter, r *http.Request) { return } - result, _ := c.App.AutocompleteUsersInTeam(teamId, name, searchOptions, c.IsSystemAdmin()) + result, err := c.App.AutocompleteUsersInTeam(teamId, name, searchOptions, c.IsSystemAdmin()) + if err != nil { + c.Err = err + return + } + autocomplete.Users = result.InTeam } else { // No permission check required - result, _ := c.App.SearchUsersInTeam("", name, searchOptions, c.IsSystemAdmin()) + result, err := c.App.SearchUsersInTeam("", name, searchOptions, c.IsSystemAdmin()) + if err != nil { + c.Err = err + return + } autocomplete.Users = result } |