From bdba73ab985fdd6112f36dff02cd0eff937759b1 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 25 Sep 2017 19:07:54 +0200 Subject: test --- lib/okpush/db.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/okpush/db.js') 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() } -- cgit v1.2.3-70-g09d2