Skip to content

Commit

Permalink
Change password minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
deniz6221 committed Nov 25, 2024
1 parent 742ee81 commit a4050d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 3Design/frontend/src/components/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const PageHeader = () => {
}
try{
setChangePasswordConfig(prev => ({...prev, sending: true}));
await axios.put(`${process.env.REACT_APP_API_URL}/${localStorage.getItem("user_id")}/change-password`,
await axios.put(`${process.env.REACT_APP_API_URL}/api/v1/users/${localStorage.getItem("user_id")}/change-password`,
null,
{headers: {Authorization: `Bearer ${localStorage.getItem("jwt_token")}`},
params: {password : changePasswordConfig.newPassword}
Expand All @@ -96,7 +96,8 @@ const PageHeader = () => {
message.success("Password successfully changed.");
setChangePasswordConfig({dialog: false, newPassword: "", sending: false});
}catch(e){
message.error("Something went wrong.")
message.error("Something went wrong.");
setChangePasswordConfig(prev => ({...prev, sending: false}));
}
}

Expand Down Expand Up @@ -155,6 +156,7 @@ const PageHeader = () => {
<p className='font-bold text-lg'>Change Your Password</p>
<TextField
label="Your New Password"
type='password'
value={changePasswordConfig.newPassword}
onChange={(e) => setChangePasswordConfig(prev => ({...prev, newPassword: e.target.value}))}
/>
Expand Down

0 comments on commit a4050d7

Please sign in to comment.