Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache helper test + eslint update #1025

Merged
merged 3 commits into from Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc
@@ -1,5 +1,5 @@
---
extends: "@dosomething/eslint-config"
extends: "@dosomething/eslint-config/nodejs/6.x"
globals:
app: true
parserOptions:
Expand Down
2 changes: 0 additions & 2 deletions app/exceptions/ClosedCampaignError.js
@@ -1,12 +1,10 @@
'use strict';

class ClosedCampaignError extends Error {

constructor(phoenixCampaign) {
super();
this.message = `Campaign ${phoenixCampaign.id} is closed.`;
}

}

module.exports = ClosedCampaignError;
2 changes: 0 additions & 2 deletions app/exceptions/UnprocessibleEntityError.js
@@ -1,12 +1,10 @@
'use strict';

class UnprocessibleEntityError extends Error {

constructor(message) {
super(message);
this.status = 422;
}

}

module.exports = UnprocessibleEntityError;
8 changes: 4 additions & 4 deletions lib/contentful.js
Expand Up @@ -72,8 +72,8 @@ module.exports.fetchSingleEntry = function fetchSingleEntry(query) {
return new Promise((resolve, reject) => {
logger.debug(`contentful.fetchSingleEntry:${JSON.stringify(query)}`);
return exports.getClient().getEntries(query)
.then(entries => resolve(underscore.first(entries.items)))
.catch(error => reject(exports.contentfulError(error)));
.then(entries => resolve(underscore.first(entries.items)))
.catch(error => reject(exports.contentfulError(error)));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation looks better, and probably makes the linter happy as well 🙂

});
};

Expand Down Expand Up @@ -109,8 +109,8 @@ module.exports.fetchKeywords = function fetchKeywords() {
.environment(process.env.NODE_ENV)
.build();
return exports.getClient().getEntries(query)
.then(response => response.items.map(item => exports.formatKeywordFromResponse(item)))
.catch(error => exports.contentfulError(error));
.then(response => response.items.map(item => exports.formatKeywordFromResponse(item)))
.catch(error => exports.contentfulError(error));
};

module.exports.fetchKeywordsForCampaignId = function (campaignId) {
Expand Down
6 changes: 3 additions & 3 deletions lib/middleware/timeouts.js
Expand Up @@ -22,7 +22,7 @@ module.exports.injectTimeoutString = function injectTimeoutString(req, res, next
next();
};

// Set respond to false so we can send our own 504 status.
// Note: Our routes will need to check for req.timedout.
// @see https://github.com/expressjs/timeout/tree/v1.8.0#api
// Set respond to false so we can send our own 504 status.
// Note: Our routes will need to check for req.timedout.
// @see https://github.com/expressjs/timeout/tree/v1.8.0#api
module.exports.timedout = timeout(`${getTimeoutNumSeconds()}s`, { respond: false });
1 change: 0 additions & 1 deletion lib/tools/profiler.js
Expand Up @@ -7,7 +7,6 @@ const EventEmitter = require('events');
* The Profiler
*/
class Profiler extends EventEmitter {

/**
* Create a new Profiler.
*
Expand Down
1 change: 0 additions & 1 deletion lib/tools/uploader.js
Expand Up @@ -7,7 +7,6 @@ const s3Stream = require('s3-upload-stream');
* The S3Uploader class.
*/
class S3Uploader {

/**
* Create a new S3Uploader
*
Expand Down