fix
This commit is contained in:
parent
33845b743d
commit
7cdbec53ee
@ -91,14 +91,7 @@ router.get('/:id', (req, res) => {
|
||||
return res.status(404).send('Unit not found');
|
||||
}
|
||||
|
||||
const user = users.find((user) => {
|
||||
if (user.public_id == unit.author) {
|
||||
return user;
|
||||
}
|
||||
});
|
||||
if (!user) {
|
||||
return res.status(404).send('User not found');
|
||||
}
|
||||
const user = users.find((user) => user.public_id == unit.author);
|
||||
|
||||
res.send({...unit, author: user});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user