feat: Implement async handler for routes

This commit is contained in:
Faruk AYDIN
2024-02-26 01:02:21 +01:00
parent 51abd74304
commit 8b4aee1afa
14 changed files with 151 additions and 30 deletions

View File

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