refactor: Use express-async-errors instead of express-async-handler

This commit is contained in:
Faruk AYDIN
2024-08-28 11:10:31 +03:00
parent 6540d0ea53
commit f7ca59bd5f
22 changed files with 68 additions and 157 deletions

View File

@@ -1,5 +1,4 @@
import { Router } from 'express';
import asyncHandler from 'express-async-handler';
import { authenticateUser } from '../../../helpers/authentication.js';
import { authorizeUser } from '../../../helpers/authorization.js';
import getFlowsAction from '../../../controllers/api/v1/flows/get-flows.js';
@@ -7,13 +6,7 @@ import getFlowAction from '../../../controllers/api/v1/flows/get-flow.js';
const router = Router();
router.get('/', authenticateUser, authorizeUser, asyncHandler(getFlowsAction));
router.get(
'/:flowId',
authenticateUser,
authorizeUser,
asyncHandler(getFlowAction)
);
router.get('/', authenticateUser, authorizeUser, getFlowsAction);
router.get('/:flowId', authenticateUser, authorizeUser, getFlowAction);
export default router;