chore: Fix api linting
This commit is contained in:
committed by
mrugesh mohapatra
parent
09e563f742
commit
0ccd0a6f77
@ -18,5 +18,5 @@ export const fixCompletedChallengeItem = obj =>
|
|||||||
'solution',
|
'solution',
|
||||||
'githubLink',
|
'githubLink',
|
||||||
'challengeType',
|
'challengeType',
|
||||||
'files',
|
'files'
|
||||||
]);
|
]);
|
||||||
|
@ -7,7 +7,7 @@ import { check } from 'express-validator/check';
|
|||||||
|
|
||||||
import { homeLocation } from '../../../config/env';
|
import { homeLocation } from '../../../config/env';
|
||||||
import { createCookieConfig } from '../utils/cookieConfig';
|
import { createCookieConfig } from '../utils/cookieConfig';
|
||||||
import {
|
import {
|
||||||
createPassportCallbackAuthenticator,
|
createPassportCallbackAuthenticator,
|
||||||
saveResponseAuthCookies,
|
saveResponseAuthCookies,
|
||||||
loginRedirect
|
loginRedirect
|
||||||
|
@ -350,7 +350,9 @@ function createShowCert(app) {
|
|||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: `We could not find a user with the username "${username}"`
|
message: `We could not find a user with the username "${
|
||||||
|
username
|
||||||
|
}"`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
@ -11,7 +11,7 @@ export default function() {
|
|||||||
return function csrf(req, res, next) {
|
return function csrf(req, res, next) {
|
||||||
|
|
||||||
const path = req.path.split('/')[1];
|
const path = req.path.split('/')[1];
|
||||||
if (/(^api$|^unauthenticated$|^internal$|^p$)/.test(path)) {
|
if ((/(^api$|^unauthenticated$|^internal$|^p$)/).test(path)) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
return protection(req, res, next);
|
return protection(req, res, next);
|
||||||
|
@ -22,26 +22,27 @@ export function getLybsynFeed() {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
return reject(err);
|
return reject(err);
|
||||||
}
|
}
|
||||||
const items = feed.map(
|
const items = feed
|
||||||
item => _.pick(item, [
|
.map(item =>
|
||||||
'full_item_url',
|
_.pick(item, [
|
||||||
'item_title',
|
'full_item_url',
|
||||||
'release_date',
|
'item_title',
|
||||||
'item_body_short'
|
'release_date',
|
||||||
])
|
'item_body_short'
|
||||||
)
|
])
|
||||||
/* eslint-disable camelcase */
|
)
|
||||||
.map(({ full_item_url, item_title, release_date, item_body_short}) => ({
|
/* eslint-disable camelcase */
|
||||||
title: item_title,
|
.map(
|
||||||
extract: item_body_short,
|
({ full_item_url, item_title, release_date, item_body_short }) => ({
|
||||||
isoDate: new Date(release_date).toISOString(),
|
title: item_title,
|
||||||
link: full_item_url
|
extract: item_body_short,
|
||||||
}));
|
isoDate: new Date(release_date).toISOString(),
|
||||||
|
link: full_item_url
|
||||||
|
})
|
||||||
|
);
|
||||||
/* eslint-enable camelcase */
|
/* eslint-enable camelcase */
|
||||||
return resolve(items);
|
return resolve(items);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ export default function populateUser(db, user) {
|
|||||||
db.collection('user')
|
db.collection('user')
|
||||||
.aggregate([
|
.aggregate([
|
||||||
{ $match: { _id: user.id } },
|
{ $match: { _id: user.id } },
|
||||||
{ $project: { points: { $size: '$progressTimestamps' } } },
|
{ $project: { points: { $size: '$progressTimestamps' } } }
|
||||||
])
|
])
|
||||||
.get(function(err, [{ points = 1 } = {}]) {
|
.get(function(err, [{ points = 1 } = {}]) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Reference in New Issue
Block a user