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');
|
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});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user