Validate request parameters
This commit is contained in:
parent
add3fea6fa
commit
de4978a854
1 changed files with 6 additions and 0 deletions
|
|
@ -1899,6 +1899,12 @@ module.exports = async (
|
|||
app.get('/api/lnd/transactions', (req, res) => {
|
||||
const { lightning } = LightningServices.services
|
||||
const { page, paginate = true, itemsPerPage } = req.query
|
||||
if (typeof page !== 'number') {
|
||||
throw new TypeError('page is not a number')
|
||||
}
|
||||
if (typeof itemsPerPage !== 'number') {
|
||||
throw new TypeError('itemsPerPage is not a number')
|
||||
}
|
||||
lightning.getTransactions({}, (err, { transactions = [] } = {}) => {
|
||||
if (err) {
|
||||
return handleError(res, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue