validation
This commit is contained in:
parent
079c13c9a1
commit
f17102de9e
1 changed files with 16 additions and 0 deletions
|
|
@ -1174,6 +1174,22 @@ module.exports = async (
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const amount = Number(amt)
|
||||||
|
|
||||||
|
if (!isARealUsableNumber(amount)) {
|
||||||
|
return res.status(400).json({
|
||||||
|
field: 'amt',
|
||||||
|
errorMessage: 'Not an usable number'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (amount < 1) {
|
||||||
|
return res.status(400).json({
|
||||||
|
field: 'amt',
|
||||||
|
errorMessage: 'Must be 1 or greater.'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return res
|
return res
|
||||||
.status(200)
|
.status(200)
|
||||||
.json(await GunActions.sendSpontaneousPayment(to, amt, memo, feeLimit))
|
.json(await GunActions.sendSpontaneousPayment(to, amt, memo, feeLimit))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue