Added a setting to update user’s profile

This commit is contained in:
Jori Lallo
2017-12-03 00:00:23 -08:00
parent e880c9295e
commit cd1d2430bb
5 changed files with 139 additions and 13 deletions

View File

@ -11,6 +11,12 @@ export default function validation() {
}
};
ctx.assertNotEmpty = function assertNotEmpty(value, message) {
if (value === '') {
throw apiError(400, 'validation_error', message);
}
};
ctx.assertEmail = (value, message) => {
if (!validator.isEmail(value)) {
throw apiError(400, 'validation_error', message);