diff --git a/backend/app/routes/faq/updateFaq.js b/backend/app/routes/faq/updateFaq.js index 6cd027a0..bd94e395 100644 --- a/backend/app/routes/faq/updateFaq.js +++ b/backend/app/routes/faq/updateFaq.js @@ -7,6 +7,7 @@ module.exports = async(req,res,next) => { if(faq == null) { return res.json({message:"invalid id"}); } + const updatedFaq = {question:req.body.question,answer:req.body.answer,isActive:req.body.isActive,tags:req.body.tags}; FAQ.findByIdAndUpdate(faqId,{$set:updatedFaq},{new:true},function(err,faq) { if (err) return res.status(500).send({error: err}); @@ -16,4 +17,4 @@ module.exports = async(req,res,next) => { catch(err) { return res.status(500).json({error:"some went wrong"}); } -} \ No newline at end of file +} diff --git a/backend/app/routes/joinUs/deleteJoinUs.js b/backend/app/routes/joinUs/deleteJoinUs.js index 3433e4f1..5d5a2aef 100644 --- a/backend/app/routes/joinUs/deleteJoinUs.js +++ b/backend/app/routes/joinUs/deleteJoinUs.js @@ -13,4 +13,4 @@ module.exports = async(req,res,next) => { catch(err) { return res.json({error: "Some internal server error"}); } -} \ No newline at end of file +} diff --git a/backend/app/routes/teamMember/addTeam.js b/backend/app/routes/teamMember/addTeam.js index 0ba89a54..e6c5a926 100644 --- a/backend/app/routes/teamMember/addTeam.js +++ b/backend/app/routes/teamMember/addTeam.js @@ -9,12 +9,12 @@ module.exports = async (req, res, next) => { res.status(401).json({ error: 'You are not an admin' }); } - const { fullName, description, linkedlinUrl, githubUrl, twitterUrl, teams } = req.body; + const { fullName, description, linkedinUrl, githubUrl, twitterUrl, teams } = req.body; const teammember = new TeamMemberModel({ full_name: fullName, - image: req.file.path, + image: req.file?.path, description, - linkedlin_url: linkedlinUrl, + linkedin_url: linkedinUrl, github_url: githubUrl, twitter_url: twitterUrl, teams, diff --git a/backend/app/routes/teamMember/deleteTeamMember.js b/backend/app/routes/teamMember/deleteTeamMember.js index b6c3aac2..d30b8a99 100644 --- a/backend/app/routes/teamMember/deleteTeamMember.js +++ b/backend/app/routes/teamMember/deleteTeamMember.js @@ -16,4 +16,4 @@ module.exports = async(req,res,next) => { return res.status(500).json({error:"Some internal server error"}); } -} \ No newline at end of file +}