feat: Implement async handler for routes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Router } from 'express';
|
||||
import asyncHandler from 'express-async-handler';
|
||||
import { authenticateUser } from '../../../helpers/authentication.js';
|
||||
import checkIsCloud from '../../../helpers/check-is-cloud.js';
|
||||
import getPlansAction from '../../../controllers/api/v1/payment/get-plans.ee.js';
|
||||
@@ -6,7 +7,18 @@ import getPaddleInfoAction from '../../../controllers/api/v1/payment/get-paddle-
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get('/plans', authenticateUser, checkIsCloud, getPlansAction);
|
||||
router.get('/paddle-info', authenticateUser, checkIsCloud, getPaddleInfoAction);
|
||||
router.get(
|
||||
'/plans',
|
||||
authenticateUser,
|
||||
checkIsCloud,
|
||||
asyncHandler(getPlansAction)
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/paddle-info',
|
||||
authenticateUser,
|
||||
checkIsCloud,
|
||||
asyncHandler(getPaddleInfoAction)
|
||||
);
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user