delete token variable
This commit is contained in:
parent
9d4afc4402
commit
965a859cbc
|
@ -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) {
|
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);
|
if (err) return returnError(err, res, req);
|
||||||
res.json(response);
|
res.json(response);
|
||||||
});
|
});
|
||||||
|
|
|
@ -2445,7 +2445,7 @@ WalletService.prototype.pushNotificationsSubscribe = function(opts, cb) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
WalletService.prototype.pushNotificationsUnsubscribe = function(token, cb) {
|
WalletService.prototype.pushNotificationsUnsubscribe = function(cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
request({
|
request({
|
||||||
|
|
|
@ -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.copayers[0].id);
|
||||||
args[0].body.user.should.contain(wallet.id);
|
args[0].body.user.should.contain(wallet.id);
|
||||||
|
args[0].body.token.should.contain('DEVICE_TOKEN');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -5487,7 +5488,7 @@ describe('Wallet service', function() {
|
||||||
request.yields();
|
request.yields();
|
||||||
helpers.getAuthServer(wallet.copayers[0].id, function(server) {
|
helpers.getAuthServer(wallet.copayers[0].id, function(server) {
|
||||||
should.exist(server);
|
should.exist(server);
|
||||||
server.pushNotificationsUnsubscribe('DEVICE_TOKEN', function(err, response) {
|
server.pushNotificationsUnsubscribe(function(err, response) {
|
||||||
should.not.exist(err);
|
should.not.exist(err);
|
||||||
var calls = request.getCalls();
|
var calls = request.getCalls();
|
||||||
calls.length.should.equal(1);
|
calls.length.should.equal(1);
|
||||||
|
|
Loading…
Reference in New Issue