Skip to content

Commit

Permalink
Merge pull request #599 from jasirneoito/597/fix-update-password-error
Browse files Browse the repository at this point in the history
fix: backend error fixed #597
  • Loading branch information
jasirtp authored Nov 30, 2021
2 parents d3fedfe + 2536aba commit 64218eb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions services/AuthService.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,19 @@ async function resetPassword(password, token) {
}

async function changePassword(passwords, userCookie) {
// console.log({ passwords });
// console.log(userId);
const item = {
currentPassword: passwords.currentPassword,
newPassword: passwords.confirmPass,
userId: userCookie.id
current_password: passwords.currentPassword,
new_password: passwords.confirmPass,
user_name: userCookie.user_name
};
try {
const { data } = await axios.post(`${baseUrl}/${changePasswordUrl}`, item, {
const { data } = await axios.put(`${baseUrl}/${changePasswordUrl}`, item, {
headers: {
"x-access-token": `${userCookie.accessToken}`
}
});
// console.log(data);
return data;
} catch (err) {
// console.log(err.response.data);
throw err;
}
}
Expand Down

0 comments on commit 64218eb

Please sign in to comment.