diff --git a/apps/admin-dashboard/app/routes/_dashboard.students.remove.tsx b/apps/admin-dashboard/app/routes/_dashboard.students.remove.tsx index 5fb59a914..37d4511d2 100644 --- a/apps/admin-dashboard/app/routes/_dashboard.students.remove.tsx +++ b/apps/admin-dashboard/app/routes/_dashboard.students.remove.tsx @@ -1,3 +1,4 @@ +import * as Sentry from '@sentry/react-router'; import { type ActionFunctionArgs, data, @@ -72,23 +73,27 @@ async function removeMembers(ids: string[]): Promise { let count = 0; for (const batch of batches) { - const students = await db - .deleteFrom('students') - .where('id', 'in', batch) - .returning(['airtableId', 'email', 'firstName', 'slackId']) - .execute(); - - for (const student of students) { - job('student.removed', { - airtableId: student.airtableId as string, - email: student.email, - firstName: student.firstName, - sendViolationEmail: false, - slackId: student.slackId, - }); + try { + const students = await db + .deleteFrom('students') + .where('id', 'in', batch) + .returning(['airtableId', 'email', 'firstName', 'slackId']) + .execute(); + + for (const student of students) { + job('student.removed', { + airtableId: student.airtableId as string, + email: student.email, + firstName: student.firstName, + sendViolationEmail: false, + slackId: student.slackId, + }); + } + + count += students.length; + } catch (e) { + Sentry.captureException(e); } - - count += students.length; } return count; @@ -141,7 +146,3 @@ export default function RemoveMembersPage() { ); } - -export function ErrorBoundary() { - return <>; -}