Skip to content

Commit c9f28eb

Browse files
committed
Ref: Previous changes reverted
1 parent 3372113 commit c9f28eb

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

.eslintrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ module.exports = {
2222
'no-trailing-spaces': 'error',
2323
'consistent-return': 'error',
2424
'no-console': 'error',
25-
semi: 0,
2625

2726
// Custom mocha rules
2827
// 'mocha/no-skipped-tests': 'error',
2928
'mocha/no-exclusive-tests': 'error'
3029
},
3130
ignorePatterns: ['public/*']
32-
};
31+
}

.prettierrc.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

middlewares/validators/user.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const joi = require('joi');
1+
const joi = require('joi')
22

33
const createUser = async (req, res, next) => {
44
const schema = joi.object().keys({
@@ -21,16 +21,16 @@ const createUser = async (req, res, next) => {
2121
isMember: joi.boolean().optional(),
2222
tokens: joi.object().optional(),
2323
website: joi.string().optional()
24-
});
24+
})
2525

2626
try {
27-
await schema.validateAsync(req.body);
28-
next();
27+
await schema.validateAsync(req.body)
28+
next()
2929
} catch (error) {
30-
logger.error(`Error validating createUser payload : ${error}`);
31-
res.boom.badRequest(error.details[0].message);
30+
logger.error(`Error validating createUser payload : ${error}`)
31+
res.boom.badRequest(error.details[0].message)
3232
}
33-
};
33+
}
3434

3535
const updateUser = async (req, res, next) => {
3636
const schema = joi.object().keys({
@@ -53,18 +53,18 @@ const updateUser = async (req, res, next) => {
5353
isMember: joi.boolean().optional(),
5454
tokens: joi.object().optional(),
5555
website: joi.string().optional()
56-
});
56+
})
5757

5858
try {
59-
await schema.validateAsync(req.body);
60-
next();
59+
await schema.validateAsync(req.body)
60+
next()
6161
} catch (error) {
62-
logger.error(`Error validating updateUser payload : ${error}`);
63-
res.boom.badRequest(error.details[0].message);
62+
logger.error(`Error validating updateUser payload : ${error}`)
63+
res.boom.badRequest(error.details[0].message)
6464
}
65-
};
65+
}
6666

6767
module.exports = {
6868
createUser,
6969
updateUser
70-
};
70+
}

0 commit comments

Comments
 (0)