Skip to content

Commit

Permalink
Merge pull request #104 from upendraTekdi/shiksha-2.0
Browse files Browse the repository at this point in the history
My Profile details changes
  • Loading branch information
itsvick authored May 10, 2024
2 parents 82f88eb + 3a318be commit 2a46c3f
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions src/pages/MyProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,34 +129,35 @@ const MyProfile = () => {
};

const fetchUserDetails = async () => {
const userId = localStorage.getItem('userId');
// const userId = '775f4baa-5593-466e-bb24-582cdf4a2d46';
console.log('userId', userId);
try {
if (userId) {
const response = await getUserDetails(userId, true);
console.log('userId', response);
if (response?.statusCode === 200) {
const data = response?.data;
if (data) {
const userData = data?.userData;
setUserData(userData);
const customDataFields = userData?.customFields;
console.log('customDataFields', customDataFields);
if (customDataFields?.length > 0) {
setCustomFieldsData(customDataFields);
if (typeof window !== 'undefined' && window.localStorage) {
const userId = localStorage.getItem('userId');

try {
if (userId) {
const response = await getUserDetails(userId, true);
console.log('userId', response);
if (response?.statusCode === 200) {
const data = response?.data;
if (data) {
const userData = data?.userData;
setUserData(userData);
const customDataFields = userData?.customFields;
console.log('customDataFields', customDataFields);
if (customDataFields?.length > 0) {
setCustomFieldsData(customDataFields);
}
} else {
console.log('No data Found');
}
} else {
console.log('No data Found');
console.log('No Response Found');
}
} else {
console.log('No Response Found');
}

// console.log(response?.result?.userData?.customFields);
// console.log(response?.result?.userData?.customFields);
}
} catch (error) {
console.error('Error fetching user details:', error);
}
} catch (error) {
console.error('Error fetching user details:', error);
}
};

Expand Down Expand Up @@ -230,8 +231,7 @@ const MyProfile = () => {
marginBottom: '2px',
}}
>
{/* {t('PROFILE.MY_PROFILE')} */}
My Profile
{t('PROFILE.MY_PROFILE')}
</Typography>
</Box>

Expand Down Expand Up @@ -291,8 +291,7 @@ const MyProfile = () => {
startIcon={<CreateOutlinedIcon />}
onClick={handleOpen}
>
Edit Profile
{/* {t('PROFILE.EDIT_PROFILE')} */}
{t('PROFILE.EDIT_PROFILE')}
</Button>

{/* modal for edit profile */}
Expand Down

0 comments on commit 2a46c3f

Please sign in to comment.