Skip to content

Commit

Permalink
added localstorage functionality for the root user
Browse files Browse the repository at this point in the history
  • Loading branch information
Devesh326 committed Jan 26, 2024
1 parent abdb000 commit 06a131c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ input UpdateUserInput {
email: EmailAddress
firstName: String
lastName: String
id: String
}

input UpdateUserPasswordInput {
Expand Down
11 changes: 7 additions & 4 deletions src/components/UserUpdate/UserUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ const UserUpdate: React.FC<InterfaceUserUpdateProps> = ({
applangcode: '',
file: '',
});
// localStorage.setItem('FirstName', firstName);
// localStorage.setItem('LastName', lastName);
// localStorage.setItem('Email', email);
// localStorage.setItem('UserImage', file);

if (localStorage.getItem('id') === currentUrl) {
localStorage.setItem('FirstName', firstName);
localStorage.setItem('LastName', lastName);
localStorage.setItem('Email', email);
localStorage.setItem('UserImage', file);
}
toast.success('Successful updated');

toggleStateValue();
Expand Down

0 comments on commit 06a131c

Please sign in to comment.