Index: remoting/webapp/crd/js/gcd_client.js |
diff --git a/remoting/webapp/crd/js/gcd_client.js b/remoting/webapp/crd/js/gcd_client.js |
index 5417737253bc796e31a1dafa3897186b5e40ab82..ab45bb124b8a0f65830a4d9f75e84f25b122c27a 100644 |
--- a/remoting/webapp/crd/js/gcd_client.js |
+++ b/remoting/webapp/crd/js/gcd_client.js |
@@ -32,7 +32,8 @@ remoting.gcd.RegistrationTicket; |
/** |
* TODO: Flesh out with typical fields. |
* @typedef {{ |
- * id:string |
+ * id:string, |
+ * name:string |
* }} |
*/ |
remoting.gcd.Device; |
@@ -206,12 +207,16 @@ remoting.gcd.Client.prototype.finalizeRegistrationTicket = function(ticketId) { |
/** |
* Lists devices user has access to. |
* TODO: Add link to GCD docs. |
+ * @param {string=} opt_nameSubstring |
Jamie
2015/04/27 22:44:06
Please document this parameter.
John Williams
2015/04/27 23:05:42
Done.
|
* @return {!Promise<!Array<remoting.gcd.Device>>} |
*/ |
-remoting.gcd.Client.prototype.listDevices = function() { |
+remoting.gcd.Client.prototype.listDevices = function(opt_nameSubstring) { |
return new remoting.Xhr({ |
method: 'GET', |
url: this.apiBaseUrl_ + '/devices', |
+ urlParams: { |
+ nameSubstring: opt_nameSubstring || null |
+ }, |
useIdentity: true, |
acceptJson: true |
}).start().then(function(response) { |
@@ -241,7 +246,7 @@ remoting.gcd.Client.prototype.deleteDevice = function(deviceId) { |
return false; |
} |
if (response.isError()) { |
- console.warn('error deleting device'); |
+ console.error('error deleting device'); |
throw remoting.Error.unexpected(); |
} |
return true; |