api/resources/Currency/CurrencyRoute.js
2024-06-18 16:49:44 +05:30

34 lines
763 B
JavaScript

import express from "express";
import {
createnew,
getAllcarrency,
updatecarrency,
deletecarrency,
} from "./CurrencyController.js";
import { isAuthenticatedUser, authorizeRoles } from "../../middlewares/auth.js";
const router = express.Router();
router
.route("/new")
.post(isAuthenticatedUser, authorizeRoles("admin", "Employee"), createnew);
router.route("/getall").get(getAllcarrency);
// router.route("/getoneblog/:id").get(getOneBlog);
router
.route("/:id")
.delete(
isAuthenticatedUser,
authorizeRoles("admin", "Employee"),
deletecarrency
);
router
.route("/:id")
.patch(
isAuthenticatedUser,
authorizeRoles("admin", "Employee"),
updatecarrency
);
export default router;