diff --git a/backend/app/routes/teamMember/addTeam.js b/backend/app/routes/teamMember/addTeam.js index 75a1df16..62ca40ce 100644 --- a/backend/app/routes/teamMember/addTeam.js +++ b/backend/app/routes/teamMember/addTeam.js @@ -9,14 +9,15 @@ module.exports = async (req, res, next) => { res.status(401).json({ error: 'You are not an admin' }); } + const { fullName, description, linkedinUrl, githubUrl, twitterUrl, teams } = req.body; const teammember = new TeamMemberModel({ - full_name: req.body?.full_name, - image: req.body?.image, - description: req.body?.description, - linkedin_url: req.body?.linkedin_url, - github_url: req.body?.github_url, - twitter_url: req.body?.twitter_url, - teams: req.body?.teams, + full_name: fullName, + image: req.file.path, + description, + linkedin_url: linkedinUrl, + github_url: githubUrl, + twitter_url: twitterUrl, + teams, }); const [err, result] = await to(teammember.save());