feat: customer auth via email

This commit is contained in:
Rafael Taranto 2023-11-28 17:36:29 +00:00
parent 92a3f16c80
commit ab304093f3
22 changed files with 252 additions and 27 deletions

View file

@ -66,8 +66,19 @@ function getPhoneTx (req, res, next) {
return next(httpError('Not Found', 404))
}
function getEmailTx (req, res, next) {
if (req.query.email) {
return helpers.fetchEmailTx(req.query.email)
.then(r => res.json(r))
.catch(next)
}
return next(httpError('Not Found', 404))
}
router.post('/', postTx)
router.get('/:id', getTx)
router.get('/', getPhoneTx)
router.get('/', getEmailTx)
module.exports = { postTx, getTx, getPhoneTx, router }
module.exports = { postTx, getTx, getPhoneTx, getEmailTx, router }