self directory

This commit is contained in:
pawan-dot 2022-10-28 15:15:17 +05:30
parent 79ab25e447
commit aa3480d90a
2 changed files with 13 additions and 13 deletions

View File

@ -13,10 +13,10 @@ export const createBanner = async (req, res) => {
}, },
function (error, result) { (result, error) }); function (error, result) { (result, error) });
const { title, startDate, endDate, subTitle } = req.body; const { title, startDate, endDate } = req.body;
const data = await Banners.create({ const data = await Banners.create({
title, title,
subTitle, // subTitle,
image: { image: {
public_id: myCloud.public_id, public_id: myCloud.public_id,
url: myCloud.secure_url, url: myCloud.secure_url,
@ -88,7 +88,7 @@ export const updateBanner = async (req, res) => {
const newBannerData = { const newBannerData = {
title: req.body.title, title: req.body.title,
subTitle: req.body.subTitle, // subTitle: req.body.subTitle,
// section: req.body.section, // section: req.body.section,
// subSection: req.body.subSection, // subSection: req.body.subSection,

View File

@ -5,10 +5,10 @@ const bannerSchema = new mongoose.Schema(
type: String, type: String,
required: true required: true
}, },
subTitle: { // subTitle: {
type: String, // type: String,
required: true // required: true
}, // },
image: image:
{ {
public_id: { public_id: {
@ -20,13 +20,13 @@ const bannerSchema = new mongoose.Schema(
required: true, required: true,
}, },
}, },
section: { // section: {
type: String, // type: String,
}, // },
subSection: { // subSection: {
type: String, // type: String,
}, // },
startDate: { startDate: {
type: Date, type: Date,