Skip to content
Snippets Groups Projects
Commit bfa48199 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

user not found message

parent 58b82517
No related branches found
No related tags found
2 merge requests!29version 0.9,!28API and Schema rework
......@@ -12,6 +12,10 @@ const getUser = () => async (
) => {
try {
res.data.profile = await Profile.findById(req.params.userId).lean().exec();
if (!res.data.profile)
return res.status(404).json({ message: "User not found" });
next();
} catch (err) {
next(err);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment