From 02d581c1599c5d50cc507bd2633f1e3c34b1cc84 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Tue, 29 Nov 2016 10:12:59 -0500
Subject: PLT-4697 Update channel switcher to autocomplete all users on the
 system (#4624)

* Add autocomplete API for system-wide users

* Update channel switcher to autocomplete all users on the system
---
 webapp/client/client.jsx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'webapp/client/client.jsx')

diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx
index 38cc2f111..ff42fb7ac 100644
--- a/webapp/client/client.jsx
+++ b/webapp/client/client.jsx
@@ -1112,7 +1112,7 @@ export default class Client {
             set(this.defaultHeaders).
             type('application/json').
             accept('application/json').
-            end(this.handleResponse.bind(this, 'autocompleteUsers', success, error));
+            end(this.handleResponse.bind(this, 'autocompleteUsersInChannel', success, error));
     }
 
     autocompleteUsersInTeam(term, success, error) {
@@ -1121,6 +1121,15 @@ export default class Client {
             set(this.defaultHeaders).
             type('application/json').
             accept('application/json').
+            end(this.handleResponse.bind(this, 'autocompleteUsersInTeam', success, error));
+    }
+
+    autocompleteUsers(term, success, error) {
+        request.
+            get(`${this.getUsersRoute()}/autocomplete?term=${encodeURIComponent(term)}`).
+            set(this.defaultHeaders).
+            type('application/json').
+            accept('application/json').
             end(this.handleResponse.bind(this, 'autocompleteUsers', success, error));
     }
 
-- 
cgit v1.2.3-1-g7c22

