docs: invite students guide

This commit is contained in:
Rotimi Best
2026-06-08 00:47:33 +01:00
parent 82d2ba4014
commit cde7b501d1
5 changed files with 153 additions and 10 deletions
-6
View File
@@ -946,8 +946,6 @@ export async function acceptStudentInvite(token: string, user: TAuthUser, contex
};
}
const courseMetadata = course.metadata as { allowNewStudent?: boolean } | null;
if (invite.roleId !== ROLE.STUDENT) {
throw new AppError('This invite is not valid for student enrollment', ErrorCodes.UNAUTHORIZED, 403);
}
@@ -956,10 +954,6 @@ export async function acceptStudentInvite(token: string, user: TAuthUser, contex
throw new AppError('This course is not available for enrollment', ErrorCodes.VALIDATION_ERROR, 400);
}
if (courseMetadata?.allowNewStudent === false) {
throw new AppError('This course is not accepting new students', ErrorCodes.VALIDATION_ERROR, 400);
}
const status = getInviteStatus(invite);
if (status === 'REVOKED') {
throw new AppError('This invite has been revoked', ErrorCodes.UNAUTHORIZED, 403);