Skip to content

Commit

Permalink
fix: stage interviews status (#2590)
Browse files Browse the repository at this point in the history
  • Loading branch information
apalchys authored Feb 4, 2025
1 parent d150703 commit 6a16d98
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/src/pages/course/student/interviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useAsync } from 'react-use';
import { CourseService } from 'services/course';
import { InterviewDetails } from 'domain/interview';
import { ActiveCourseProvider, SessionContext, SessionProvider, useActiveCourseContext } from 'modules/Course/contexts';
import { CoursesInterviewsApi, InterviewDto, TaskDtoTypeEnum } from 'api';
import { CoursesInterviewsApi, CourseTaskDtoTypeEnum, InterviewDto, TaskDtoTypeEnum } from 'api';
import { InterviewCard, NoInterviewsAlert } from 'modules/Interview/Student';

const coursesInterviewApi = new CoursesInterviewsApi();
Expand Down Expand Up @@ -69,8 +69,11 @@ function StudentInterviewPage() {

const getRegisteredInterviews = async (interviews: InterviewDto[]) => {
try {
const requests = interviews.map(async ({ id }) => {
const data = await courseService.getInterviewStudent(session.githubId, id.toString()).catch(() => null);
const requests = interviews.map(async ({ type, id }) => {
const data =
type === CourseTaskDtoTypeEnum.StageInterview
? await courseService.getInterviewStudent(session.githubId, 'stage').catch(() => null)
: await courseService.getInterviewStudent(session.githubId, id.toString()).catch(() => null);
return data ? id.toString() : null;
});

Expand Down

0 comments on commit 6a16d98

Please sign in to comment.