diff --git a/src/const/schema.js b/src/const/schema.js index dbc602f4..e33f2ec6 100644 --- a/src/const/schema.js +++ b/src/const/schema.js @@ -2,7 +2,7 @@ import Joi from 'joi' import libphonenumber from 'google-libphonenumber' const checkPhone = (phone) => { - let phoneStr = phone + let phoneStr = `${phone}` if (/^\+\d+ /.test(phoneStr)) { phoneStr = phoneStr.replace(/^\+\d+ /, '') } @@ -23,7 +23,8 @@ const schema = Joi.object({ return helper.message("phone is incorrect") } return value - }) + }), + Joi.number() ).required(), url: Joi.string().uri().optional(), workEmail: Joi.array().items(Joi.string().email()).optional()