import express from "express";
import { isAuthenticatedUser, authorizeRoles } from "../../middlewares/auth.js";
import {
  addBrand,
  deleteBrand,
  getBrands,
  updateBrand,
} from "./BrandsController.js";

const router = express.Router();

router
  .route("/add")
  .post(isAuthenticatedUser, authorizeRoles("admin"), addBrand);

router.route("/getBrands").get(getBrands);

router
  .route("/update/:_id")
  .patch(isAuthenticatedUser, authorizeRoles("admin"), updateBrand);

router
  .route("/delete/:_id")
  .delete(isAuthenticatedUser, authorizeRoles("admin"), deleteBrand);

export default router;
