Cleared of the stuff the EnCoach team wanted changed
This commit is contained in:
@@ -33,7 +33,7 @@ export const getServerSideProps = withIronSessionSsr(async ({req, res, query}) =
|
||||
if (assignmentID) {
|
||||
const assignment = await getAssignment(assignmentID)
|
||||
|
||||
if (!assignment) return redirect("/exercises")
|
||||
if (!assignment) return redirect("/exam")
|
||||
if (!["admin", "developer"].includes(user.type) && !assignment.assignees.includes(user.id)) return redirect("/exercises")
|
||||
|
||||
const exams = await getExamsByIds(uniqBy(assignment.exams, "id"))
|
||||
@@ -44,7 +44,7 @@ export const getServerSideProps = withIronSessionSsr(async ({req, res, query}) =
|
||||
moment(assignment.startDate).isBefore(moment()) ||
|
||||
moment(assignment.endDate).isAfter(moment())
|
||||
)
|
||||
return redirect("/exercises")
|
||||
return redirect("/exam")
|
||||
|
||||
return {
|
||||
props: serialize({user, assignment, exams, session})
|
||||
|
||||
Reference in New Issue
Block a user