Skip to content

Commit

Permalink
Issue #PS-000 feat: Fixed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvick committed Aug 12, 2024
1 parent e6065da commit 3c0f1d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/AttendanceComparison.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const AttendanceComparison: React.FC<AttendanceComparisonProps> = ({

useEffect(() => {
const cohortIds =
store?.cohorts?.map((pair: Cohort) => pair?.cohortId) || [];
store?.cohorts?.filter((item: Cohort) => item?.cohortType === centerType).map((pair: Cohort) => pair?.cohortId) || [];

const fetchData = async () => {
const promises = cohortIds?.map((cohortId: string) =>
Expand All @@ -93,7 +93,7 @@ const AttendanceComparison: React.FC<AttendanceComparisonProps> = ({
if (result?.statusCode === 200 && result?.data?.result?.contextId) {
Object.keys(result?.data?.result?.contextId).forEach((id) => {
dataMap[id] =
result?.data?.result?.contextId[id]?.present_percentage || '0';
result?.data?.result?.contextId[id]?.present_percentage ?? '0';
});
}
});
Expand All @@ -110,7 +110,7 @@ const AttendanceComparison: React.FC<AttendanceComparisonProps> = ({
};

fetchData();
}, [store?.cohorts, scope]);
}, [store?.cohorts, scope, centerType]);

const data =
store?.cohorts
Expand Down
4 changes: 2 additions & 2 deletions src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
import {
AttendancePercentageProps,
CohortAttendancePercentParam,
CohortMemberList,
ICohort,
CohortMemberList,
} from '../utils/Interfaces';
import { accessControl, lowLearnerAttendanceLimit } from './../../app.config';

Expand All @@ -31,7 +31,6 @@ import OverviewCard from '@/components/OverviewCard';
import { showToastMessage } from '@/components/Toastify';
import WeekCalender from '@/components/WeekCalender';
import { getMyCohortMemberList } from '@/services/MyClassDetailsService';
import { Role } from '@/utils/app.constant';
import { calculatePercentage } from '@/utils/attendanceStats';
import { logEvent } from '@/utils/googleAnalytics';
import withAccessControl from '@/utils/hoc/withAccessControl';
Expand All @@ -49,6 +48,7 @@ import calendar from '../assets/images/calendar.svg';
import Header from '../components/Header';
import Loader from '../components/Loader';
import useDeterminePathColor from '../hooks/useDeterminePathColor';
import { Role } from '@/utils/app.constant';

interface DashboardProps { }

Expand Down

0 comments on commit 3c0f1d9

Please sign in to comment.