From 56723b9b9ab3e10131029649214ca11bc58292fb Mon Sep 17 00:00:00 2001 From: Rushikesh-Sonawane99 Date: Wed, 8 May 2024 12:10:19 +0530 Subject: [PATCH] #Issue #PS-286 chore: Fixed loader issue and added cohortId to get cohort member list dynamically --- src/pages/Dashboard.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx index 443f111d..81640c6f 100644 --- a/src/pages/Dashboard.tsx +++ b/src/pages/Dashboard.tsx @@ -162,10 +162,10 @@ const Dashboard: React.FC = () => { const parentCohortId = localStorage.getItem('parentCohortId'); const formattedDate: string = currentDate; try { - if (userId && classId && parentCohortId) { + if (userId && classId && parentCohortId) { let limit = "100"; let page = 0; - let filters = { cohortId: "2e09f3b6-e571-476e-a536-e1bf3a061e46" }; //Hard coded for testing replace it with classId + let filters = { cohortId: classId }; //Hard coded for testing replace it with classId const response = await getMyCohortMemberList({ limit , page, @@ -196,7 +196,9 @@ const Dashboard: React.FC = () => { } catch (error) { console.error('Error fetching cohort list:', error); setLoading(false); - } + }finally { + setLoading(false); + } }; if (classId.length) {