diff --git a/resources/Content/ContentController.js b/resources/Content/ContentController.js index 05396e7..14a7f8c 100644 --- a/resources/Content/ContentController.js +++ b/resources/Content/ContentController.js @@ -29,12 +29,10 @@ export const AddTermsAndConditions = async (req, res) => { export const getTermsAndCondition = async (req, res) => { try { - if (!req?.user) return res.status(400).json({ message: "please login !" }); + // if (!req?.user) return res.status(400).json({ message: "please login !" }); // console.log(req?.user) - const termsAndCondition = await TermsAndCondition.find({ - addedBy: req.user._id, - }); + const termsAndCondition = await TermsAndCondition.find(); res.status(200).json({ success: true, @@ -105,12 +103,10 @@ export const AddPrivacyAndPolicy = async (req, res) => { export const getPrivacyPolicy = async (req, res) => { try { - if (!req?.user) return res.status(400).json({ message: "please login !" }); + // if (!req?.user) return res.status(400).json({ message: "please login !" }); // console.log(req?.user) - const privacyAndPolicy = await PrivacyAndPolicy.find({ - addedBy: req.user._id, - }); + const privacyAndPolicy = await PrivacyAndPolicy.find(); res.status(200).json({ success: true, @@ -181,12 +177,10 @@ export const AddShipping = async (req, res) => { export const getShipping = async (req, res) => { try { - if (!req?.user) return res.status(400).json({ message: "please login !" }); + // if (!req?.user) return res.status(400).json({ message: "please login !" }); // console.log(req?.user) - const shipping = await Shipping.find({ - addedBy: req.user._id, - }); + const shipping = await Shipping.find(); res.status(200).json({ success: true, diff --git a/resources/Content/ContentRoutes.js b/resources/Content/ContentRoutes.js index b5a8dc4..dbefc41 100644 --- a/resources/Content/ContentRoutes.js +++ b/resources/Content/ContentRoutes.js @@ -19,7 +19,7 @@ router .post(isAuthenticatedUser, authorizeRoles("admin"), AddTermsAndConditions); router .route("/terms-and-conditions") - .get(isAuthenticatedUser, authorizeRoles("admin"), getTermsAndCondition); + .get(getTermsAndCondition); router .route("/terms-and-condition-update") .patch( @@ -32,7 +32,7 @@ router .post(isAuthenticatedUser, authorizeRoles("admin"), AddPrivacyAndPolicy); router .route("/privacy-and-policy") - .get(isAuthenticatedUser, authorizeRoles("admin"), getPrivacyPolicy); + .get(getPrivacyPolicy); router .route("/privacy-and-policy-update") .patch(isAuthenticatedUser, authorizeRoles("admin"), updatePrivacyPolicy); @@ -42,7 +42,7 @@ router .post(isAuthenticatedUser, authorizeRoles("admin"), AddShipping); router .route("/shipping-and-policy") - .get(isAuthenticatedUser, authorizeRoles("admin"), getShipping); + .get(getShipping); router .route("/shipping-and-policy-update") .patch(isAuthenticatedUser, authorizeRoles("admin"), updateShipping);