diff --git a/controllers/bannerController.js b/controllers/bannerController.js index 6ff2759..19db268 100644 --- a/controllers/bannerController.js +++ b/controllers/bannerController.js @@ -14,7 +14,8 @@ export const createBanner = async (req, res) => { folder: "cmp/image", }, function (error, result) { (result, error) }); - const { title, section, startDate, endDate, subTitle } = req.body; + + const { title, section, startDate, subSection, endDate, subTitle } = req.body; const data = await Banners.create({ title, subTitle, @@ -24,7 +25,8 @@ export const createBanner = async (req, res) => { }, section, startDate, - endDate + endDate, + subSection }); diff --git a/models/bannerModel.js b/models/bannerModel.js index 04422d0..c6c7354 100644 --- a/models/bannerModel.js +++ b/models/bannerModel.js @@ -24,6 +24,10 @@ const bannerSchema = new mongoose.Schema( type: String, required: true }, + subSection: { + type: String, + }, + startDate: { type: Date, required: true diff --git a/tmp/tmp-1-1656486816946 b/tmp/tmp-1-1656486816946 new file mode 100644 index 0000000..25c0dfa Binary files /dev/null and b/tmp/tmp-1-1656486816946 differ diff --git a/tmp/tmp-1-1656487168539 b/tmp/tmp-1-1656487168539 new file mode 100644 index 0000000..25c7510 Binary files /dev/null and b/tmp/tmp-1-1656487168539 differ diff --git a/tmp/tmp-2-1656487337756 b/tmp/tmp-2-1656487337756 new file mode 100644 index 0000000..6fb99c9 Binary files /dev/null and b/tmp/tmp-2-1656487337756 differ