Skip to content

Commit

Permalink
Merge pull request #221 from Aar-if/bugFixes
Browse files Browse the repository at this point in the history
Issue #0000 chore: resolved build issue
  • Loading branch information
itsvick authored Sep 3, 2024
2 parents 72c1c09 + 00dbe56 commit 5a77b4e
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/components/CohortFacilitatorList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,19 @@ const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
const resp = response?.result?.userDetails;

if (resp) {
const userDetails = resp.map((user: any) => ({
name: toPascalCase(user.name),
userId: user.userId,
memberStatus: user.status,
statusReason: user.statusReason,
cohortMembershipId: user.cohortMembershipId,
enrollmentNumber: capitalizeEachWord(
getFieldValue(
user?.customField,
'fieldname',
'Enrollment Number',
'fieldvalues',
'-'
)
),
}));
const userDetails = resp.map((user: any) => {
const ageField = user.customField.find((field: { label: string }) => field.label === "AGE");
return {
name: toPascalCase(user?.name),
userId: user?.userId,
memberStatus: user?.status,
statusReason: user?.statusReason,
cohortMembershipId: user?.cohortMembershipId,
enrollmentNumber: user?.username,
age: ageField ? ageField.value : null, // Extract age for the specific user
};
});

console.log(`userDetails`, userDetails);
setUserData(userDetails);
}
Expand Down Expand Up @@ -113,6 +110,7 @@ const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
userId={data.userId}
learnerName={data.name}
enrollmentId={data.enrollmentNumber}
age={data.age}
cohortMembershipId={data.cohortMembershipId}
isDropout={data.memberStatus === Status.DROPOUT}
statusReason={data.statusReason}
Expand Down

0 comments on commit 5a77b4e

Please sign in to comment.