Skip to content

Commit ee68cb8

Browse files
committed
Ref(user.js): phone_number key changed to phone
1 parent e823205 commit ee68cb8

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

.eslintrc.js

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

2627
// Custom mocha rules
2728
// 'mocha/no-skipped-tests': 'error',
2829
'mocha/no-exclusive-tests': 'error'
2930
},
3031
ignorePatterns: ['public/*']
31-
}
32+
};

.prettierrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"use strict";
2+
3+
module.exports = {
4+
singleQuote: true,
5+
};

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)