2025-05-04 20:06:57 +00:00
|
|
|
/*import { checkTabContext, checkUserIsAdmin } from "@/contexts/auth/infraestructure";
|
|
|
|
|
import { ListUsersSchema, buildListUsersController } from "@/contexts/auth/presentation";
|
2025-05-02 21:43:51 +00:00
|
|
|
import { validateAndParseBody } from "@/core/common/presentation";
|
2025-02-15 21:30:12 +00:00
|
|
|
import { NextFunction, Request, Response, Router } from "express";
|
|
|
|
|
|
2025-02-21 11:25:46 +00:00
|
|
|
export const usersRouter = (appRouter: Router) => {
|
2025-02-24 19:00:28 +00:00
|
|
|
const routes: Router = Router({ mergeParams: true });
|
2025-02-15 21:30:12 +00:00
|
|
|
|
2025-02-24 19:00:28 +00:00
|
|
|
routes.get(
|
2025-02-15 21:30:12 +00:00
|
|
|
"/",
|
2025-04-01 17:05:17 +00:00
|
|
|
validateAndParseBody(ListUsersSchema),
|
2025-02-20 18:55:24 +00:00
|
|
|
checkTabContext,
|
2025-02-21 11:25:46 +00:00
|
|
|
checkUserIsAdmin,
|
2025-02-20 18:55:24 +00:00
|
|
|
(req: Request, res: Response, next: NextFunction) => {
|
2025-04-01 14:26:15 +00:00
|
|
|
buildListUsersController().execute(req, res, next);
|
2025-02-15 21:30:12 +00:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2025-02-24 19:00:28 +00:00
|
|
|
appRouter.use("/users", routes);
|
2025-02-15 21:30:12 +00:00
|
|
|
};
|
2025-05-04 20:06:57 +00:00
|
|
|
*/
|