From 69a19099fa5f601d9f6babbe4ab4cacd937c24dd Mon Sep 17 00:00:00 2001 From: pawan-dot <71133473+pawan-dot@users.noreply.github.com> Date: Thu, 23 Jun 2022 17:10:04 +0530 Subject: [PATCH] make it --- controllers/cmp-restriction-Controller.js | 10 +++++----- models/cmp-restriction-model.js | 2 +- routes/cmp-restriction-Route.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) 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)