import { Router } from "express";

import { UserController } from "./user.controller";
import { authMiddleware } from "../auth/auth.middleware";

const userRouter = Router();

const controller = new UserController();

userRouter.get("/", authMiddleware, controller.getAll);

userRouter.get("/:id", authMiddleware, controller.getById);

userRouter.post("/", controller.create);

userRouter.put("/:id", authMiddleware, controller.update);

userRouter.delete("/:id", authMiddleware, controller.delete);

export default userRouter;