Skip to content

Commit

Permalink
Merge pull request #1077 from OneCommunityGlobal/Ivy-pwd-error-BE
Browse files Browse the repository at this point in the history
Ivy-pwd-error-BE
  • Loading branch information
one-community authored Sep 5, 2024
2 parents 97dd0af + 6c33cd1 commit 3b06327
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/controllers/logincontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const logincontroller = function () {

res.status(200).send({ token });
} else {
res.status(403).send({
res.status(404).send({
message: 'Invalid password.',
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/logincontroller.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('logincontroller module', () => {
expect(findOneSpy).toHaveBeenCalledWith({ email: mockReqModified.body.email });

assertResMock(
403,
404,
{
message: 'Invalid password.',
},
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/userProfileController.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,14 +724,14 @@ const userProfileController = function (UserProfile, Project) {
})
.catch((error) => {
if (error.name === 'ValidationError' && error.errors.lastName) {
const errors = Object.values(error.errors).map(er => er.message);
const errors = Object.values(error.errors).map((er) => er.message);
return res.status(400).json({
message: 'Validation Error',
error: errors,
});
}
console.error('Failed to save record:', error);
return res.status(400).json({ error: 'Failed to save record.' });
console.error('Failed to save record:', error);
return res.status(400).json({ error: 'Failed to save record.' });
});
});
};
Expand Down

0 comments on commit 3b06327

Please sign in to comment.