mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
chore: relocate backend into apps/api ahead of monorepo merge
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -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 };
|
||||
Reference in New Issue
Block a user