Commit 602166df authored by Joe Wilm's avatar Joe Wilm

Fix bug with editDevice not including app_id

The OneSignal API requires passing `app_id` in device update calls.
parent 0168b473
...@@ -276,6 +276,9 @@ Client.prototype.editDevice = function (deviceId, body, callback) { ...@@ -276,6 +276,9 @@ Client.prototype.editDevice = function (deviceId, body, callback) {
if (!this.app) { if (!this.app) {
throw 'You must define an "app" object.' throw 'You must define an "app" object.'
} }
if (!('app_id' in body)) {
body.app_id = this.app.appId;
}
return basicRequest(this.API_URI + constants.DEVICES_PATH + '/' + deviceId, this.app.appAuthKey, 'PUT', body, callback); return basicRequest(this.API_URI + constants.DEVICES_PATH + '/' + deviceId, this.app.appAuthKey, 'PUT', body, callback);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment