diff --git a/packages/server/lib/routes.js b/packages/server/lib/routes.js index c4e8f6b0..8cc61c32 100644 --- a/packages/server/lib/routes.js +++ b/packages/server/lib/routes.js @@ -25,7 +25,7 @@ const performanceRoutes = require('./routes/performanceRoutes') const rejectIncompatibleMachines = require('./middlewares/rejectIncompatbleMachines') const stateRoutes = require('./routes/stateRoutes') const termsAndConditionsRoutes = require('./routes/termsAndConditionsRoutes') -const { router: txRoutes } = require('./routes/txRoutes') +const txRoutes = require('./routes/txRoutes') const verifyUserRoutes = require('./routes/verifyUserRoutes') const verifyTxRoutes = require('./routes/verifyTxRoutes') const verifyPromoCodeRoutes = require('./routes/verifyPromoCodeRoutes') diff --git a/packages/server/lib/routes/txRoutes.js b/packages/server/lib/routes/txRoutes.js index 524650b6..cdbcc32e 100644 --- a/packages/server/lib/routes/txRoutes.js +++ b/packages/server/lib/routes/txRoutes.js @@ -64,7 +64,7 @@ function getTx(req, res, next) { return next(httpError('Not Found', 404)) } -function getPhoneTx(req, res, next) { +function getPhoneOrEmailTx(req, res, next) { if (req.query.phone) { return helpers .fetchPhoneTx(req.query.phone) @@ -72,10 +72,6 @@ function getPhoneTx(req, res, next) { .catch(next) } - return next(httpError('Not Found', 404)) -} - -function getEmailTx(req, res, next) { if (req.query.email) { return helpers .fetchEmailTx(req.query.email) @@ -88,7 +84,6 @@ function getEmailTx(req, res, next) { router.post('/', postTx) router.get('/:id', getTx) -router.get('/', getPhoneTx) -router.get('/', getEmailTx) +router.get('/', getPhoneOrEmailTx) -module.exports = { postTx, getTx, getPhoneTx, getEmailTx, router } +module.exports = router