This commit is contained in:
rgrgogu
2026-05-05 23:18:47 +08:00
parent 5aeb959e92
commit a8f10a25d7
38 changed files with 5992 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
/***********************************************************************************************************************************************************************
* File Name: profile.validator.js
* Type of Program: Validator
* Description: express-validator rule chains for profile update endpoints.
* Author: rgrgogu
* Date Created: Oct. 6, 2025
***********************************************************************************************************************************************************************/
const { body } = require('express-validator');
const updateProfileValidator = [
body('personal_info').optional().isObject().withMessage('personal_info must be an object.'),
body('personal_info.name').optional().isObject(),
body('personal_info.name.given_name').optional().isString().trim().isLength({ max: 100 }),
body('personal_info.name.last_name').optional().isString().trim().isLength({ max: 100 }),
body('personal_info.occupation').optional().isString().trim().isLength({ max: 150 }),
body('personal_info.date_of_birth').optional().isDate().withMessage('date_of_birth must be a valid date.'),
];
module.exports = { updateProfileValidator };