Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop : fixed birthdate update at user portal for all users #3497

8 changes: 5 additions & 3 deletions src/screens/MemberDetail/MemberDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const MemberDetail: React.FC<MemberDetailProps> = ({ id }): JSX.Element => {
appLanguageCode: '',
image: '',
gender: '',
birthDate: '2024-03-14',
birthDate: '',
grade: '',
empStatus: '',
maritalStatus: '',
Expand Down Expand Up @@ -241,8 +241,10 @@ const MemberDetail: React.FC<MemberDetailProps> = ({ id }): JSX.Element => {
try {
const { data } = await updateUser({
variables: {
id: currentUrl,
...formState,
data: {
id: currentUrl,
...formState,
},
},
});
if (data) {
Expand Down
11 changes: 7 additions & 4 deletions src/screens/UserPortal/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export default function settings(): JSX.Element {
updatedUserDetails = { ...updatedUserDetails, image: '' };
}
const { data } = await updateUserDetails({
variables: updatedUserDetails,
variables: {
data: updatedUserDetails,
},
});
if (data) {
toast.success(
Expand All @@ -112,6 +114,7 @@ export default function settings(): JSX.Element {
setItem('name', userFullName);
}
} catch (error: unknown) {
console.log(error);
bandhan-majumder marked this conversation as resolved.
Show resolved Hide resolved
errorHandler(t, error);
}
};
Expand Down Expand Up @@ -455,9 +458,9 @@ export default function settings(): JSX.Element {
type="date"
id="birthDate"
value={userDetails.birthDate}
onChange={(e) =>
handleFieldChange('birthDate', e.target.value)
}
onChange={(e) => {
handleFieldChange('birthDate', e.target.value);
}}
className={`${styles.cardControl}`}
max={new Date().toISOString().split('T')[0]}
/>
Expand Down
Loading