Updated the batch user creation to work without corporate
This commit is contained in:
@@ -34,6 +34,7 @@ import {capitalize, uniqBy} from "lodash";
|
||||
import moment from "moment";
|
||||
import Head from "next/head";
|
||||
import {useRouter} from "next/router";
|
||||
import { useMemo } from "react";
|
||||
import {BsBook, BsClipboard, BsFileEarmarkText, BsHeadphones, BsMegaphone, BsPen, BsPencil, BsStar} from "react-icons/bs";
|
||||
import {ToastContainer} from "react-toastify";
|
||||
|
||||
@@ -58,14 +59,13 @@ export const getServerSideProps = withIronSessionSsr(async ({req, res}) => {
|
||||
const entityIDS = mapBy(user.entities, "id") || [];
|
||||
|
||||
const entities = await getEntitiesWithRoles(entityIDS);
|
||||
const allAssignments = await getAssignmentsByAssignee(user.id, {archived: false});
|
||||
const assignments = await getAssignmentsByAssignee(user.id, {archived: false});
|
||||
const stats = await getStatsByUser(user.id);
|
||||
const sessions = await getSessionsByUser(user.id, 10);
|
||||
const invites = await getInvitesByInvitee(user.id);
|
||||
const grading = await getGradingSystemByEntity(entityIDS[0] || "");
|
||||
|
||||
const formattedInvites = await Promise.all(invites.map(convertInvitersToUsers));
|
||||
const assignments = allAssignments.filter(activeAssignmentFilter);
|
||||
|
||||
const examIDs = uniqBy(
|
||||
assignments.flatMap((a) =>
|
||||
@@ -104,7 +104,7 @@ export default function Dashboard({user, entities, assignments, stats, invites,
|
||||
}
|
||||
};
|
||||
|
||||
const studentAssignments = assignments.filter(activeAssignmentFilter);
|
||||
const studentAssignments = useMemo(() => assignments.filter(activeAssignmentFilter), [assignments]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user