diff --git a/common/models/notification.js b/common/models/notification.js index cae6d2a..925683a 100644 --- a/common/models/notification.js +++ b/common/models/notification.js @@ -558,10 +558,10 @@ module.exports = function (Notification) { headers: { 'Content-Type': 'application/json', }, - data: data, } Notification.request.post( data.asyncBroadcastPushNotification, + data, options ) } diff --git a/server/cron-tasks.js b/server/cron-tasks.js index a67df4a..50eba8f 100644 --- a/server/cron-tasks.js +++ b/server/cron-tasks.js @@ -391,9 +391,12 @@ module.exports.checkRssConfigUpdates = function () { headers: { 'Content-Type': 'application/json', }, - data: notificationObject, } - module.exports.request.post(url, options) + module.exports.request.post( + url, + notificationObject, + options + ) } }) lastSavedRssData.items = items.concat( diff --git a/spec/app/cron.spec.js b/spec/app/cron.spec.js index 7882451..daecff1 100644 --- a/spec/app/cron.spec.js +++ b/spec/app/cron.spec.js @@ -387,10 +387,9 @@ describe('CRON checkRssConfigUpdates', function () { expect(cronTasks.request.post).toHaveBeenCalledWith( 'http://foo/api/notifications', joc({ - data: joc({ - httpHost: 'http://foo', - }), - }) + httpHost: 'http://foo', + }), + jasmine.any(Object) ) let results = await app.models.Rss.find() expect(results[0].items[0].author).toBe('foo') diff --git a/spec/app/notification.spec.js b/spec/app/notification.spec.js index d5cd363..e4a9c5b 100644 --- a/spec/app/notification.spec.js +++ b/spec/app/notification.spec.js @@ -568,6 +568,7 @@ describe('POST /notifications', function () { expect(data[0].state).toBe('sent') expect(app.models.Notification.request.post).toHaveBeenCalledWith( 'http://foo.com', + jasmine.any(Object), jasmine.any(Object) ) }) @@ -682,6 +683,7 @@ describe('POST /notifications', function () { expect(data[0].state).toBe('sent') expect(app.models.Notification.request.post).toHaveBeenCalledWith( 'http://foo.com', + jasmine.any(Object), jasmine.any(Object) ) expect(app.models.Notification.sendEmail).toHaveBeenCalledTimes(2)