fix validation misconfiguration
This commit is contained in:
parent
8f7cac2242
commit
a1d42ac398
2 changed files with 5 additions and 2 deletions
|
|
@ -45,7 +45,7 @@ export const createOrderValidator = [
|
|||
.isString()
|
||||
.matches(NON_NEGATIVE_REAL_NUMBER_REGEX)
|
||||
.withMessage('orderData.amount must be a positive decimal string'),
|
||||
body('orderData.pairId').isString().withMessage('orderData.pairId must be a string'),
|
||||
body('orderData.pairId').isNumeric().withMessage('orderData.pairId must be a number'),
|
||||
];
|
||||
|
||||
export default CreateOrderBody;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,10 @@ class Middleware {
|
|||
if (!errors.isEmpty()) {
|
||||
res.status(500).send({
|
||||
success: false,
|
||||
data: 'Internal error',
|
||||
data: errors
|
||||
.array()
|
||||
.map((err) => err.msg)
|
||||
.join(', '),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue