diff --git a/backend/apis/nodejs/src/app.js b/backend/apis/nodejs/src/app.js index 6e94238..3fc8107 100644 --- a/backend/apis/nodejs/src/app.js +++ b/backend/apis/nodejs/src/app.js @@ -23,7 +23,6 @@ const helmet = require('helmet') const personRoutes = require('./routes/person_routes.js'); const organizationRoutes = require('./routes/organization_routes.js'); const organizationAdminRoutes = require('./routes/organization_admin_routes.js'); -const organizationPostRoutes = require('./routes/organization_post_routes.js'); const jobOffersRoutes = require('./routes/job_offer_routes.js'); const serverRoutes = require('./routes/server_routes.js'); const resetPasswordRoutes = require('./routes/reset_password_routes.js'); @@ -55,7 +54,6 @@ app.use('/api/persons', personRoutes.protectedRoutes); app.use('/api/organizations', organizationRoutes.routes); app.use('/api/organizations', jobOffersRoutes.routes); app.use('/api/organizations', organizationAdminRoutes.routes); -app.use('/api/organizations', organizationPostRoutes.routes); app.use('/api/resetpassword', resetPasswordRoutes.routes); /* diff --git a/backend/apis/nodejs/src/utils/validators/person_validator.js b/backend/apis/nodejs/src/utils/validators/person_validator.js index 24f2251..43e055f 100644 --- a/backend/apis/nodejs/src/utils/validators/person_validator.js +++ b/backend/apis/nodejs/src/utils/validators/person_validator.js @@ -50,17 +50,17 @@ const updatePersonValidator = [ }), check('dateOfBirth').optional().isDate().withMessage('Invalid date format. Date must be YYYY-MM-DD'), check('openToWork').optional().isBoolean(), - check('placeOfLiving').isLength({ + check('placeOfLiving').optional().isLength({ max: 128 }).escape(), - check('aboutMe').isLength({ + check('aboutMe').optional().isLength({ max: 4096 }).escape(), - check('qualification').isLength({ + check('qualification').optional().isLength({ max: 64 }).escape(), - check('old_password').trim().escape(), - check('new_password').isLength({ + check('oldPassword').optional().trim().escape(), + check('newPassword').optional().isLength({ min: 5 }).trim().escape().withMessage('Password must be at least 5 characters'), ];