fix: error messages dont match validation

This commit is contained in:
José Oliveira 2021-03-23 18:38:10 +00:00 committed by Josh Harvey
parent b367653e09
commit 17554f2847

View file

@ -124,8 +124,7 @@ const Schema = Yup.object()
return message return message
}, },
txVelocity: threshold => { txVelocity: threshold => {
const thresholdMessage = const thresholdMessage = 'Transactions must be greater than 0'
'Transactions must be greater than or equal to 0'
const thresholdDaysMessage = 'Days must be greater than 0' const thresholdDaysMessage = 'Days must be greater than 0'
let message = '' let message = ''
if (threshold.threshold <= 0) message = message.concat(thresholdMessage) if (threshold.threshold <= 0) message = message.concat(thresholdMessage)
@ -136,7 +135,7 @@ const Schema = Yup.object()
console.log(message) console.log(message)
return message return message
}, },
consecutiveDays: threshold => 'Days must be greater than or equal to 0' consecutiveDays: threshold => 'Days must be greater than 0'
} }
const thresholdValidator = { const thresholdValidator = {
txAmount: threshold => threshold.threshold >= 0, txAmount: threshold => threshold.threshold >= 0,