diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-09-25 19:07:54 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-09-25 19:07:54 +0200 |
| commit | bdba73ab985fdd6112f36dff02cd0eff937759b1 (patch) | |
| tree | a4af98001c26e53ff932e5650459059fb3b0583c /lib/okpush/db.js | |
| parent | 709af63b290214b79271d96518e2ed51468e09f3 (diff) | |
test
Diffstat (limited to 'lib/okpush/db.js')
| -rw-r--r-- | lib/okpush/db.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/okpush/db.js b/lib/okpush/db.js index 09afdf34..4e000725 100644 --- a/lib/okpush/db.js +++ b/lib/okpush/db.js @@ -109,7 +109,7 @@ function getDeviceCount (channels, cb) { /* notifications */ -function addNotification (channel, cb) { +function addNotification (channel, message, cb) { var now = new Date Channel.findOrCreate({channel: channel}, {last_push: now}, function(err, note, created) { if (err) { @@ -123,8 +123,9 @@ function addNotification (channel, cb) { } cb(null, note) }) - new Notification ({ + return new Notification ({ channel: channel, + message: message || "", date: now, }).save() } |
