diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-02-16 18:32:08 +0100 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-02-16 18:32:08 +0100 |
| commit | d3d195470caef02891de58ed25b92a02c088c37d (patch) | |
| tree | af3531e9efe2fe32407b7bde4fc1828e60564b98 /lib/okpush/index.js | |
| parent | f40e2286faef696c25a81c04635aaf737606a39a (diff) | |
routes
Diffstat (limited to 'lib/okpush/index.js')
| -rw-r--r-- | lib/okpush/index.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/okpush/index.js b/lib/okpush/index.js index a9ba12eb..a509c891 100644 --- a/lib/okpush/index.js +++ b/lib/okpush/index.js @@ -69,6 +69,7 @@ function OKPush (options) { // pass in admin middleware! router.get('/admin', function (req, res) { + // change this to get notification counts for each channel db.getNotifications(function(err, notes){ db.getDeviceCount(function(err, count){ var data = { @@ -100,14 +101,17 @@ function OKPush (options) { // should work without middleware router.post('/add', function (req, res) { - // add a key - db. - registrationId: localStorage.getItem("yoox.registrationId"), - channel: channel, - platform, + db.addToken({ + token: req.body.registrationId, + channel: req.body.channel, + platform: req.body.platform, + }) }) router.post('/remove', function (req, res) { - // remove a key + db.removeToken({ + token: req.body.registrationId, + channel: req.body.channel, + }) }) this._router = router |
