Continued with clearing more of the team's requests
This commit is contained in:
@@ -50,7 +50,10 @@ export const getServerSideProps = withIronSessionSsr(async ({req, res, params})
|
||||
if (!assignment) return redirect("/assignments")
|
||||
|
||||
const entity = await getEntityWithRoles(assignment.entity || "")
|
||||
if (!entity) return redirect("/assignments")
|
||||
if (!entity){
|
||||
const users = await getUsers()
|
||||
return {props: serialize({user, users, assignment})};
|
||||
}
|
||||
|
||||
if (!doesEntityAllow(user, entity, 'view_assignments')) return redirect("/assignments")
|
||||
|
||||
@@ -63,7 +66,7 @@ interface Props {
|
||||
user: User;
|
||||
users: User[];
|
||||
assignment: Assignment;
|
||||
entity: EntityWithRoles
|
||||
entity?: EntityWithRoles
|
||||
}
|
||||
|
||||
export default function AssignmentView({user, users, entity, assignment}: Props) {
|
||||
|
||||
Reference in New Issue
Block a user