import express from "express";
import { isAuthenticatedUser, authorizeRoles } from "../../middlewares/auth.js";

import {
  addImage,
  deleteImage,
  getImage,
  updateImage,
  CreateAndUpdateImage,
} from "./RegistrationImageController.js";
const router = express.Router();

router
  .route("/add")
  .post(isAuthenticatedUser, authorizeRoles("admin", "Employee"), addImage);
router.route("/getImage").get(getImage);
router
  .route("/update/:_id")
  .patch(isAuthenticatedUser, authorizeRoles("admin", "Employee"), updateImage);
router
  .route("/addmodify")
  .post(
    isAuthenticatedUser,
    authorizeRoles("admin", "Employee"),
    CreateAndUpdateImage
  );
router
  .route("/delete/:_id")
  .delete(
    isAuthenticatedUser,
    authorizeRoles("admin", "Employee"),
    deleteImage
  );

export default router;
