changes in website content
This commit is contained in:
parent
14ad8c09f4
commit
2710f78ba6
@ -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,
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user