This commit is contained in:
pawan-dot 2022-06-23 17:10:04 +05:30
parent 7c3cd09564
commit 69a19099fa
3 changed files with 8 additions and 8 deletions

View File

@ -23,12 +23,12 @@ export const createRestriction = async (req, res) => {
export const getAllRestriction = async (req, res) => { export const getAllRestriction = async (req, res) => {
try { try {
const Restriction = await cmpRestrictionModel.find(); const CmpRestriction = await cmpRestrictionModel.find();
// console.log(news) // console.log(news)
res.status(200).json({ res.status(200).json({
success: true, success: true,
msg: " fetch Successfully!!", msg: " fetch Successfully!!",
Restriction, CmpRestriction,
}); });
} catch (error) { } catch (error) {
res.status(500).json({ res.status(500).json({
@ -43,12 +43,12 @@ export const getAllRestriction = async (req, res) => {
export const getOneRestriction = async (req, res) => { export const getOneRestriction = async (req, res) => {
try { try {
const CmpRes = await cmpRestrictionModel.findById(req.params.id); const CmpRestriction = await cmpRestrictionModel.findById(req.params.id);
res.status(200).json({ res.status(200).json({
success: true, success: true,
msg: " fetch Restriction Successfully!!", msg: " fetch Restriction Successfully!!",
CmpRes, CmpRestriction,
}); });
} catch (error) { } catch (error) {
// console.log(error) // console.log(error)
@ -65,7 +65,7 @@ export const updateRestriction = async (req, res) => {
try { try {
// console.log(req.body) // console.log(req.body)
const newResData = { const newResData = {
Abaut_Us: req.body.Abaut_Us, About_Us: req.body.Abaut_Us,
Terms_and_Conditions: req.body.Terms_and_Conditions, Terms_and_Conditions: req.body.Terms_and_Conditions,
Privacy_Policy: req.body.Privacy_Policy, Privacy_Policy: req.body.Privacy_Policy,
}; };

View File

@ -1,7 +1,7 @@
import mongoose from "mongoose" import mongoose from "mongoose"
const cmpRisSchema = new mongoose.Schema( const cmpRisSchema = new mongoose.Schema(
{ {
Abaut_Us: { About_Us: {
type: String, type: String,
required: true required: true
}, },

View File

@ -1,13 +1,13 @@
import express from "express"; import express from "express";
import { import {
// createRestriction, createRestriction,
getAllRestriction, getAllRestriction,
updateRestriction, updateRestriction,
getOneRestriction getOneRestriction
} from "../controllers/cmp-restriction-Controller.js" } from "../controllers/cmp-restriction-Controller.js"
const router = express.Router(); const router = express.Router();
// router.route("/restriction/create/").post(createRestriction) router.route("/restriction/create/").post(createRestriction)
import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js" import { isAuthenticatedUser, authorizeRoles } from "../middlewares/auth.js"
router.route("/restriction/getAll").get(getAllRestriction) router.route("/restriction/getAll").get(getAllRestriction)