kfu-m-24-1/eng-it-lean quick fix #86

Merged
qosquo merged 4 commits from kfu-m-24-1/eng-it-lean into master 2025-02-05 19:33:52 +03:00
Showing only changes of commit 7cdbec53ee - Show all commits

View File

@ -91,14 +91,7 @@ router.get('/:id', (req, res) => {
return res.status(404).send('Unit not found'); return res.status(404).send('Unit not found');
} }
const user = users.find((user) => { const user = users.find((user) => user.public_id == unit.author);
if (user.public_id == unit.author) {
return user;
}
});
if (!user) {
return res.status(404).send('User not found');
}
res.send({...unit, author: user}); res.send({...unit, author: user});
}); });