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

Commit

Permalink
changed statusCode to status
Browse files Browse the repository at this point in the history
  • Loading branch information
f-w committed Jun 1, 2020
1 parent ed7344b commit 8f535d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions common/models/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,10 @@ module.exports = function (Notification) {
.get(uri)
.then(function (response) {
const body = response.data
if (response.statusCode === 200) {
if (response.status === 200) {
return cb && cb(null, body)
}
throw new Error(statusCode)
throw new Error(response.status)
})
.catch(function (error) {
Notification.app.models.Subscription.find(
Expand Down
2 changes: 1 addition & 1 deletion server/cron-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ module.exports.checkRssConfigUpdates = function() {
responseType: 'stream'
})
.then(function(res) {
if (res.statusCode !== 200) {
if (res.status !== 200) {
reject(new Error('Bad status code'))
} else {
res.data.pipe(feedparser)
Expand Down
4 changes: 2 additions & 2 deletions spec/app/cron.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ describe('CRON checkRssConfigUpdates', function() {
spyOn(cronTasks, 'request').and.callFake(async function() {
var output = fs.createReadStream(__dirname + path.sep + 'rss.xml')
return {
statusCode: 200,
status: 200,
data: output
}
})
Expand Down Expand Up @@ -457,7 +457,7 @@ describe('CRON checkRssConfigUpdates', function() {
it('should handle error', async function() {
cronTasks.request = jasmine.createSpy().and.callFake(async function() {
return {
statusCode: 300
status: 300
}
})
try {
Expand Down

0 comments on commit 8f535d2

Please sign in to comment.