Skip to content
Snippets Groups Projects
Commit 983c582f authored by elit04's avatar elit04
Browse files

check if Id exists again(previous version was not right/full)

parent 5045b66f
No related branches found
No related tags found
No related merge requests found
......@@ -127,6 +127,10 @@ const updateAccount = async (req: Request, res: Response) => {
},
});
if (checkIfIdExists === null) {
return res.status(404).json({ success: false, error: "accountNotFound" });
}
//hash given password
if (input.password !== undefined) {
input.password = await bcrypt.hash(input.password, 10);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment