Skip to content

Commit c690ced

Browse files
committed
fix: update users with intake access in intake_users
1 parent 2e94298 commit c690ced

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/backend/lib/intake.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ intake.get('/api/intake', limiter, async (req, res) => {
8383
},
8484
};
8585
// first check if the user is already on the table
86-
// NOTE: adjust logic if there are future intakes
87-
const intakeUsers =
88-
currentIntake?.data?.session?.ccbcUserBySub?.intakeUsersByUserId?.nodes;
89-
if (intakeUsers.length > 0) {
86+
const userAlreadyOnIntake =
87+
currentIntake?.data?.session?.ccbcUserBySub?.intakeUsersByUserId?.nodes?.some(
88+
(node) => node.intakeId === intakeRowId
89+
) ?? false;
90+
if (userAlreadyOnIntake) {
9091
return res.redirect('/applicantportal/dashboard');
9192
}
9293
const userResult = await performQuery(

0 commit comments

Comments
 (0)