Updated the way groups work there
This commit is contained in:
@@ -53,7 +53,7 @@ interface Props {
|
||||
user: MasterCorporateUser;
|
||||
}
|
||||
|
||||
type StudentPerformanceItem = User & {corporate?: CorporateUser; group: string};
|
||||
type StudentPerformanceItem = User & {corporate?: CorporateUser; group?: Group};
|
||||
const StudentPerformanceList = ({items, stats, users, groups}: {items: StudentPerformanceItem[]; stats: Stat[]; users: User[]; groups: Group[]}) => {
|
||||
const [isShowingAmount, setIsShowingAmount] = useState(false);
|
||||
const [availableCorporates] = useState(
|
||||
@@ -82,7 +82,7 @@ const StudentPerformanceList = ({items, stats, users, groups}: {items: StudentPe
|
||||
}),
|
||||
columnHelper.accessor("group", {
|
||||
header: "Group",
|
||||
cell: (info) => info.getValue(),
|
||||
cell: (info) => info.getValue()?.name || "N/A",
|
||||
}),
|
||||
columnHelper.accessor("corporate", {
|
||||
header: "Corporate",
|
||||
@@ -372,7 +372,7 @@ export default function MasterCorporateDashboard({user}: Props) {
|
||||
.filter((x) => x.type === "student" && groups.flatMap((g) => g.participants).includes(x.id))
|
||||
.map((u) => ({
|
||||
...u,
|
||||
group: groups.find((x) => x.participants.includes(u.id))?.name || "N/A",
|
||||
group: groups.find((x) => x.participants.includes(u.id)),
|
||||
corporate: getCorporateUser(u, users, groups),
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user