Resolve linter issues

This commit is contained in:
Chi Vinh Le
2018-06-05 04:28:54 +02:00
parent d9a1d739dc
commit ccff6ed63b
148 changed files with 1171 additions and 265 deletions
@@ -32,7 +32,9 @@ module.exports = connectors => {
try {
// Grab some settings.
const { loaders: { Settings } } = ctx;
const {
loaders: { Settings },
} = ctx;
const {
organizationName,
organizationContactEmail,
@@ -16,7 +16,12 @@ const {
// generateDownloadLinks will generate a signed set of links for a given user to
// download an archive of their data.
async function generateDownloadLinks(ctx, userID) {
const { connectors: { url: { BASE_URL }, secrets } } = ctx;
const {
connectors: {
url: { BASE_URL },
secrets,
},
} = ctx;
// Generate a token for the download link.
const token = await secrets.jwt.sign(
@@ -42,7 +47,10 @@ async function sendDownloadLink(ctx) {
const {
user,
loaders: { Settings },
connectors: { services: { Users, I18n, Limit }, models: { User } },
connectors: {
services: { Users, I18n, Limit },
models: { User },
},
} = ctx;
// downloadLinkLimiter can be used to limit downloads for the user's data to
@@ -107,7 +115,10 @@ async function sendDownloadLink(ctx) {
async function requestDeletion({
user,
loaders: { Settings },
connectors: { models: { User }, services: { Users, I18n } },
connectors: {
models: { User },
services: { Users, I18n },
},
}) {
// Ensure the user doesn't already have a deletion scheduled.
if (get(user, 'metadata.scheduledDeletionDate')) {
@@ -153,7 +164,10 @@ async function requestDeletion({
async function cancelDeletion({
user,
loaders: { Settings },
connectors: { models: { User }, services: { I18n, Users } },
connectors: {
models: { User },
services: { I18n, Users },
},
}) {
// Ensure the user has a deletion scheduled.
const scheduledDeletionDate = get(
@@ -8,7 +8,11 @@ const stringify = require('csv-stringify');
const { ErrDownloadToken } = require('./errors');
async function verifyDownloadToken(
{ connectors: { services: { Users } } },
{
connectors: {
services: { Users },
},
},
token
) {
const jwt = await Users.verifyToken(token, {
@@ -139,7 +143,12 @@ module.exports = router => {
return;
}
const { connectors: { graph: { Context }, errors } } = req.context;
const {
connectors: {
graph: { Context },
errors,
},
} = req.context;
try {
// Pull the userID and the date that the token was issued out of the