alone valid else i should res.send(error)
As per my knowledge I would use express validator Module and use isnotempty() like methods
any ideas for this ?
const keys = Object.keys(req.body); if (keys.length === 1 && keys[0] === 'myfield') { // valid } else { // invalid }
Обсуждают сегодня