diff --git a/controllers/cmp-restriction-Controller.js b/controllers/cmp-restriction-Controller.js index dffb252..5a88143 100644 --- a/controllers/cmp-restriction-Controller.js +++ b/controllers/cmp-restriction-Controller.js @@ -23,12 +23,12 @@ export const createRestriction = async (req, res) => { export const getAllRestriction = async (req, res) => { try { - const Restriction = await cmpRestrictionModel.find(); + const CmpRestriction = await cmpRestrictionModel.find(); // console.log(news) res.status(200).json({ success: true, msg: " fetch Successfully!!", - Restriction, + CmpRestriction, }); } catch (error) { res.status(500).json({ @@ -43,12 +43,12 @@ export const getAllRestriction = async (req, res) => { export const getOneRestriction = async (req, res) => { try { - const CmpRes = await cmpRestrictionModel.findById(req.params.id); + const CmpRestriction = await cmpRestrictionModel.findById(req.params.id); res.status(200).json({ success: true, msg: " fetch Restriction Successfully!!", - CmpRes, + CmpRestriction, }); } catch (error) { // console.log(error) @@ -65,7 +65,7 @@ export const updateRestriction = async (req, res) => { try { // console.log(req.body) const newResData = { - Abaut_Us: req.body.Abaut_Us, + About_Us: req.body.Abaut_Us, Terms_and_Conditions: req.body.Terms_and_Conditions, Privacy_Policy: req.body.Privacy_Policy, }; diff --git a/models/cmp-restriction-model.js b/models/cmp-restriction-model.js index ccd788b..5455e84 100644 --- a/models/cmp-restriction-model.js +++ b/models/cmp-restriction-model.js @@ -1,7 +1,7 @@ import mongoose from "mongoose" const cmpRisSchema = new mongoose.Schema( { - Abaut_Us: { + About_Us: { type: String, required: true }, diff --git a/routes/cmp-restriction-Route.js b/routes/cmp-restriction-Route.js index d3919dd..39e3c8b 100644 --- a/routes/cmp-restriction-Route.js +++ b/routes/cmp-restriction-Route.js @@ -1,13 +1,13 @@ import express from "express"; import { - // createRestriction, + createRestriction, getAllRestriction, updateRestriction, getOneRestriction } from "../controllers/cmp-restriction-Controller.js" const router = express.Router(); -// router.route("/restriction/create/").post(createRestriction) +router.route("/restriction/create/").post(createRestriction) import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" router.route("/restriction/getAll").get(getAllRestriction)