From b0725a271265f3f89dd65cdf2ff35133909c105c Mon Sep 17 00:00:00 2001 From: xfarrow <49845537+xfarrow@users.noreply.github.com> Date: Mon, 24 Mar 2025 12:51:38 +0100 Subject: [PATCH] Update person_routes.js --- backend/apis/nodejs/src/routes/person_routes.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/apis/nodejs/src/routes/person_routes.js b/backend/apis/nodejs/src/routes/person_routes.js index 12c57cc..04e4d0f 100644 --- a/backend/apis/nodejs/src/routes/person_routes.js +++ b/backend/apis/nodejs/src/routes/person_routes.js @@ -146,8 +146,13 @@ async function getPerson(req, res) { const person = await Person.findById(req.params.id); if (person && person.enabled) { delete person.password; // remove password field for security reasons + + // Add contact infos const contactInfos = await PersonContactInfo.getInfoByPerson(person.id); person.contact_infos = contactInfos; + + // TODO: Add experiences + return res.status(200).send(person); } return res.status(404).json({ @@ -174,6 +179,13 @@ async function getMyself(req, res) { const person = await Person.findById(req.jwt.person_id); if (person) { delete person.password; + + // Add contact infos + const contactInfos = await PersonContactInfo.getInfoByPerson(person.id); + person.contact_infos = contactInfos; + + // TODO: Add experiences + return res.status(200).send(person); } return res.status(404).json({ @@ -286,7 +298,7 @@ async function updatePerson(req, res) { * */ async function deletePerson(req, res) { - // TODO: Delete Organization if this user was its only administrator + // TODO: Delete an Organization if this user was its only administrator try { await Person.remove(req.jwt.person_id); return res.status(204).send();