chore: commit lint fixes for the api

This commit is contained in:
Bouncey
2019-02-06 14:19:58 +00:00
committed by mrugesh mohapatra
parent 010fa63e76
commit 07266b7e43
17 changed files with 159 additions and 154 deletions

View File

@ -115,10 +115,10 @@ export default function(UserIdent) {
return identity
? Observable.of(identity.user())
: User.findOne$({ where: { email } }).flatMap(user => {
return user
? Observable.of(user)
: User.create$({ email }).toPromise();
});
return user
? Observable.of(user)
: User.create$({ email }).toPromise();
});
})
.flatMap(user => {
const createToken = observeQuery(AccessToken, 'create', {

View File

@ -4,14 +4,19 @@ export function dashify(str) {
return ('' + str)
.toLowerCase()
.replace(/\s/g, '-')
.replace(/[^a-z0-9\-\.]/gi, '')
.replace(/\:/g, '');
.replace(/[^a-z0-9\-.]/gi, '')
.replace(/:/g, '');
}
// todo: unify with server/utils/index.js:dasherize
const dasherize = dashify;
export { dasherize };
export const fixCompletedChallengeItem = obj => pick(
obj,
[ 'id', 'completedDate', 'solution', 'githubLink', 'challengeType', 'files' ]
);
export const fixCompletedChallengeItem = obj =>
pick(obj, [
'id',
'completedDate',
'solution',
'githubLink',
'challengeType',
'files',
]);