refactor: Use express-async-errors instead of express-async-handler
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Router } from 'express';
|
||||
import asyncHandler from 'express-async-handler';
|
||||
import { authenticateUser } from '../../../../helpers/authentication.js';
|
||||
import { authorizeAdmin } from '../../../../helpers/authorization.js';
|
||||
import getUsersAction from '../../../../controllers/api/v1/admin/users/get-users.ee.js';
|
||||
@@ -8,20 +7,8 @@ import deleteUserAction from '../../../../controllers/api/v1/admin/users/delete-
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get('/', authenticateUser, authorizeAdmin, asyncHandler(getUsersAction));
|
||||
|
||||
router.get(
|
||||
'/:userId',
|
||||
authenticateUser,
|
||||
authorizeAdmin,
|
||||
asyncHandler(getUserAction)
|
||||
);
|
||||
|
||||
router.delete(
|
||||
'/:userId',
|
||||
authenticateUser,
|
||||
authorizeAdmin,
|
||||
asyncHandler(deleteUserAction)
|
||||
);
|
||||
router.get('/', authenticateUser, authorizeAdmin, getUsersAction);
|
||||
router.get('/:userId', authenticateUser, authorizeAdmin, getUserAction);
|
||||
router.delete('/:userId', authenticateUser, authorizeAdmin, deleteUserAction);
|
||||
|
||||
export default router;
|
||||
|
Reference in New Issue
Block a user