Skip to content

Commit

Permalink
fix: show cancel interview button for supervisor (#2428)
Browse files Browse the repository at this point in the history
  • Loading branch information
valerydluski authored Feb 12, 2024
1 parent 0e56bea commit c504e26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/src/pages/course/admin/stage-interviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useMemo, useState, useContext } from 'react';
import { CourseService } from 'services/course';
import { CourseRole } from 'services/models';
import { useAsync } from 'react-use';
import { isCourseManager } from 'domain/user';
import { isCourseManager, isCourseSupervisor } from 'domain/user';
import { ActiveCourseProvider, SessionContext, SessionProvider, useActiveCourseContext } from 'modules/Course/contexts';

function Page() {
Expand All @@ -22,6 +22,7 @@ function Page() {

const courseService = useMemo(() => new CourseService(courseId), [courseId]);
const courseManagerRole = useMemo(() => isCourseManager(session, courseId), [course, session]);
const courseSupervisorRole = useMemo(() => isCourseSupervisor(session, courseId), [course, session]);

const loadInterviews = async () => setInterviews(await courseService.getStageInterviews());

Expand Down Expand Up @@ -104,7 +105,7 @@ function Page() {
dataIndex: 'actions',
width: 80,
render: (_, record) => {
if (courseManagerRole) {
if (courseManagerRole || courseSupervisorRole) {
return (
<Button type="link" onClick={() => deleteInterview(record)}>
Cancel
Expand Down

0 comments on commit c504e26

Please sign in to comment.