Skip to content

Commit c79ac18

Browse files
committed
sysco feature done
1 parent a02b060 commit c79ac18

File tree

6 files changed

+53
-4
lines changed

6 files changed

+53
-4
lines changed
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
const brandLogo = require("../../models/brands/HomeModel");
2+
const acoDb=require("../../models/brands/AccordionModel")
23
const BrandLogoService = require("../../services/brands/BrandLogoService");
4+
const SyscoFeatureService=require("../../services/brands/SyscoFeatureCreateService");
35

46

57
//Upload Logo
68

79
exports.uploadBrand = async (req, res) => {
810
let Result = await BrandLogoService(req, brandLogo)
911
res.status(200).json(Result);
10-
};
12+
};
13+
14+
//Create Sysco Feature
15+
16+
exports.createFeature=async (req,res)=>{
17+
let Result = await SyscoFeatureService(req, acoDb)
18+
res.status(200).json(Result);
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const mongoose = require('mongoose');
2+
const Accordion = mongoose.Schema({
3+
syscoDescription: {
4+
type: String,
5+
max: 7000
6+
7+
},
8+
syscoFeatures: {
9+
title:{
10+
type:String,
11+
max:500
12+
},
13+
description:{
14+
type:String,
15+
max:7000
16+
}
17+
18+
}
19+
20+
})
21+
22+
const accordion = mongoose.model('accordion', Accordion)
23+
module.exports=accordion;

src/models/brands/HomeModel.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ const DataSchema = mongoose.Schema({
77
}
88

99

10-
},{versionKey: false})
10+
}, {versionKey: false})
11+
12+
13+
1114

1215
const brandLogoModel = mongoose.model('brandLogo', DataSchema);
16+
17+
1318
module.exports = brandLogoModel;

src/models/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
const BlogModel = require("../models/blogs/BlogModel");
22
const OTPSModel = require("../models/users/OTPSModel");
33
const UserModel = require("../models/users/UserModel");
4+
const brandLogoModel=require("../models/brands/HomeModel");
45

56

67
module.exports = {
7-
BlogModel, OTPSModel, UserModel
8+
BlogModel, OTPSModel, UserModel,brandLogoModel
89
}

src/routes/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ router.post("/FilterByBlog", BlogController.FilterByCategory);
3636
router.post("/sendMail",UserController.SendMail);
3737

3838
//BrandLOGO API
39-
4039
router.post("/logoUpload",BrandController.uploadBrand);
40+
router.post("/createFeature",BrandController.createFeature);
4141
module.exports = router;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const SyscoFeatureCreateService = async (Request, acoDb) => {
2+
try {
3+
let PostBody = Request.body;
4+
let data = await acoDb.create(PostBody)
5+
return {status: "success", data: data}
6+
} catch (error) {
7+
return {status: "Failed", data: error.toString()}
8+
}
9+
}
10+
11+
module.exports = SyscoFeatureCreateService;

0 commit comments

Comments
 (0)