Browse Source

delete token variable

activeAddress
Gabriel Bazán 9 years ago
parent
commit
965a859cbc
  1. 4
      lib/expressapp.js
  2. 2
      lib/server.js
  3. 3
      test/integration/server.js

4
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);
});

2
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({

3
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);

Loading…
Cancel
Save