Skip to content

Commit 0c33e42

Browse files
Updated express-validator to 7.3.1 and updated syntax on validation.js to match
1 parent fba6d93 commit 0c33e42

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

services/ehr-out-service/package-lock.json

Lines changed: 15 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/ehr-out-service/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dotenv": "^16.0.0",
3131
"expect": "^29.3.1",
3232
"express": "^4.19.2",
33-
"express-validator": "^6.14.0",
33+
"express-validator": "^7.3.1",
3434
"fast-xml-parser": "^4.2.5",
3535
"lodash.chunk": "^4.2.0",
3636
"lodash.clonedeep": "^4.5.0",

services/ehr-out-service/src/middleware/validation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const validate = (req, res, next) => {
88
return next();
99
}
1010

11-
const mappedErrors = errors.array().map(err => ({ [err.param]: err.msg }));
11+
const mappedErrors = errors.array().map(err => ({ [err.path]: err.msg }));
1212
logError('validation-failed', { validation: { errors: mappedErrors } });
1313

1414
return res.status(422).json({

0 commit comments

Comments
 (0)