Skip to content

Commit

Permalink
fix: resolve object key issue
Browse files Browse the repository at this point in the history
  • Loading branch information
WONYOUNG-HC committed Dec 26, 2024
1 parent a33c9f2 commit 4570815
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pages/Attendance/Attend/AttendanceAttend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useBreakpoints } from '@/hooks/useBreakpoints';
import { useGeolocation } from 'react-use';
import api from '@/api/api';
import {
CotatoAttendanceResponse,
CotatoAttendanceResponseSessionTypeEnum,
CotatoAttendResponse,
} from 'cotato-openapi-clients';
Expand Down Expand Up @@ -62,8 +63,7 @@ const AttendanceAttend: React.FC = () => {
sessionId: sessionId,
});

const sessionTitle = currentAttendance?.sessionTitle;
const { data: attendanceData } = useSWR(
const { data: attendanceData } = useSWR<CotatoAttendanceResponse>(
`/v2/api/attendances/${currentAttendance?.attendanceId}`,
fetcher,
);
Expand Down Expand Up @@ -201,7 +201,7 @@ const AttendanceAttend: React.FC = () => {
const renderSessionInfo = () => {
return (
<Typography variant="h5" color={theme.colors.common.black} fontFamily="YComputer">
{currentGeneration?.generationNumber}{sessionTitle}
{currentGeneration?.generationNumber}{attendanceData?.sessionTitle}
</Typography>
);
};
Expand All @@ -224,15 +224,15 @@ const AttendanceAttend: React.FC = () => {
{Object.entries(AttendanceStatusEnum)
.filter(([key]) => {
switch (key) {
case AttendanceStatusEnum.OFFLINE:
case 'OFFLINE':
return (
attendanceData?.sessionType === CotatoAttendanceResponseSessionTypeEnum.All ||
attendanceData.sessionType === CotatoAttendanceResponseSessionTypeEnum.Offline
attendanceData?.sessionType === CotatoAttendanceResponseSessionTypeEnum.Offline
);
case AttendanceStatusEnum.ONLINE:
case 'ONLINE':
return (
attendanceData?.sessionType === CotatoAttendanceResponseSessionTypeEnum.All ||
attendanceData.sessionType === CotatoAttendanceResponseSessionTypeEnum.Online
attendanceData?.sessionType === CotatoAttendanceResponseSessionTypeEnum.Online
);
default:
return false;
Expand Down

0 comments on commit 4570815

Please sign in to comment.