diff --git a/lib/expressapp.js b/lib/expressapp.js index bfc402b..cd06558 100644 --- a/lib/expressapp.js +++ b/lib/expressapp.js @@ -672,9 +672,25 @@ ExpressApp.prototype.start = function(opts, cb) { }); }); + // DEPRECATED router.delete('/v1/pushnotifications/subscriptions/', function(req, res) { + logDeprecated(req); + getServerWithAuth(req, res, function(server) { + server.pushNotificationsUnsubscribe({ + token: 'dummy' + }, function(err, response) { + if (err) return returnError(err, res, req); + res.json(response); + }); + }); + }); + + router.delete('/v2/pushnotifications/subscriptions/:token', function(req, res) { + var opts = { + token: req.params['token'], + }; getServerWithAuth(req, res, function(server) { - server.pushNotificationsUnsubscribe(function(err, response) { + server.pushNotificationsUnsubscribe(opts, function(err, response) { if (err) return returnError(err, res, req); res.json(response); });