api/resources/Content/ContentRoutes.js
2024-03-28 12:40:38 +05:30

57 lines
1.6 KiB
JavaScript

import express from "express";
import {
AddPrivacyAndPolicy,
AddShipping,
AddTermsAndConditions,
RefundPolicy,
getPrivacyPolicy,
getRefundPolicy,
getShipping,
getTermsAndCondition,
updatePrivacyPolicy,
updateShipping,
updateTermsAndConditions,
updateRefundPolicy
} from "./ContentController.js";
import { isAuthenticatedUser, authorizeRoles } from "../../middlewares/auth.js";
const router = express.Router();
router
.route("/terms-and-conditions")
.post(isAuthenticatedUser, authorizeRoles("admin"), AddTermsAndConditions);
router.route("/terms-and-conditions").get(getTermsAndCondition);
router
.route("/terms-and-condition-update")
.patch(
isAuthenticatedUser,
authorizeRoles("admin"),
updateTermsAndConditions
);
router
.route("/privacy-and-policy")
.post(isAuthenticatedUser, authorizeRoles("admin"), AddPrivacyAndPolicy);
router.route("/privacy-and-policy").get(getPrivacyPolicy);
router
.route("/privacy-and-policy-update")
.patch(isAuthenticatedUser, authorizeRoles("admin"), updatePrivacyPolicy);
router
.route("/shipping-and-policy")
.post(isAuthenticatedUser, authorizeRoles("admin"), AddShipping);
router.route("/shipping-and-policy").get(getShipping);
router
.route("/shipping-and-policy-update")
.patch(isAuthenticatedUser, authorizeRoles("admin"), updateShipping);
//refund Policy
router.route("/refund-policy").get(getRefundPolicy);
router
.route("/refund-policy")
.post(isAuthenticatedUser, authorizeRoles("admin"), RefundPolicy);
router
.route("/refund-policy-update")
.patch(isAuthenticatedUser, authorizeRoles("admin"), updateRefundPolicy);
//
export default router;