diff --git a/lib/expressapp.js b/lib/expressapp.js index af850fb..aefc0a2 100644 --- a/lib/expressapp.js +++ b/lib/expressapp.js @@ -527,9 +527,9 @@ ExpressApp.prototype.start = function(opts, cb) { }); }); - router.delete('/v1/pushnotifications/subscriptions/:token/', function(req, res) { + router.delete('/v1/pushnotifications/subscriptions/', function(req, res) { getServerWithAuth(req, res, function(server) { - server.pushNotificationsUnsubscribe(req.params['token'], function(err, response) { + server.pushNotificationsUnsubscribe(function(err, response) { if (err) return returnError(err, res, req); res.json(response); }); diff --git a/lib/server.js b/lib/server.js index e4bb3ef..9b731c1 100644 --- a/lib/server.js +++ b/lib/server.js @@ -2445,7 +2445,7 @@ WalletService.prototype.pushNotificationsSubscribe = function(opts, cb) { }); }; -WalletService.prototype.pushNotificationsUnsubscribe = function(token, cb) { +WalletService.prototype.pushNotificationsUnsubscribe = function(cb) { var self = this; request({ diff --git a/test/integration/server.js b/test/integration/server.js index 63a2de3..b245558 100644 --- a/test/integration/server.js +++ b/test/integration/server.js @@ -5478,6 +5478,7 @@ describe('Wallet service', function() { }); args[0].body.user.should.contain(wallet.copayers[0].id); args[0].body.user.should.contain(wallet.id); + args[0].body.token.should.contain('DEVICE_TOKEN'); done(); }); }); @@ -5487,7 +5488,7 @@ describe('Wallet service', function() { request.yields(); helpers.getAuthServer(wallet.copayers[0].id, function(server) { should.exist(server); - server.pushNotificationsUnsubscribe('DEVICE_TOKEN', function(err, response) { + server.pushNotificationsUnsubscribe(function(err, response) { should.not.exist(err); var calls = request.getCalls(); calls.length.should.equal(1);