Skip to content

Commit

Permalink
fixes updation of applangcode functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Devesh326 committed Jan 26, 2024
1 parent 06a131c commit dc6b68d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 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
applangcode: String
id: String
}

Expand Down
2 changes: 2 additions & 0 deletions src/GraphQl/Mutations/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const UPDATE_USER_MUTATION = gql`
$lastName: String
$email: EmailAddress
$id: String
$applangcode: String
$file: String
) {
updateUserProfile(
Expand All @@ -82,6 +83,7 @@ export const UPDATE_USER_MUTATION = gql`
lastName: $lastName
email: $email
id: $id
applangcode: $applangcode
}
file: $file
) {
Expand Down
6 changes: 6 additions & 0 deletions src/components/UserUpdate/UserUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import { toast } from 'react-toastify';
import { errorHandler } from 'utils/errorHandler';
import { Form } from 'react-bootstrap';
import Loader from 'components/Loader/Loader';
// import useLocalStorage from 'utils/useLocalStorage';

// const { getItem, setItem } = useLocalStorage();

interface InterfaceUserUpdateProps {
id: string;
Expand Down Expand Up @@ -54,6 +57,7 @@ const UserUpdate: React.FC<InterfaceUserUpdateProps> = ({
firstName: data?.user?.firstName,
lastName: data?.user?.lastName,
email: data?.user?.email,
applangcode: data?.user?.applangcode,
});
}
}, [data]);
Expand All @@ -72,6 +76,7 @@ const UserUpdate: React.FC<InterfaceUserUpdateProps> = ({
const firstName = formState.firstName;
const lastName = formState.lastName;
const email = formState.email;
const applangcode = formState.applangcode;
const file = formState.file;
let toSubmit = true;
if (firstName.trim().length == 0 || !firstName) {
Expand All @@ -94,6 +99,7 @@ const UserUpdate: React.FC<InterfaceUserUpdateProps> = ({
firstName,
lastName,
email,
applangcode,
file,
},
});
Expand Down

0 comments on commit dc6b68d

Please sign in to comment.