Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
bug fixing for module.exports.request.post
Browse files Browse the repository at this point in the history
  • Loading branch information
f-w committed Jun 1, 2020
1 parent aaf32b6 commit 973917d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion common/models/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,10 @@ module.exports = function (Notification) {
headers: {
'Content-Type': 'application/json',
},
data: data,
}
Notification.request.post(
data.asyncBroadcastPushNotification,
data,
options
)
}
Expand Down
7 changes: 5 additions & 2 deletions server/cron-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 3 additions & 4 deletions spec/app/cron.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 2 additions & 0 deletions spec/app/notification.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
})
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 973917d

Please sign in to comment.