From af05f10ddd4551db18d7b8ca93530d568ed699a8 Mon Sep 17 00:00:00 2001 From: Rami Abdou Date: Tue, 23 Jul 2024 15:03:18 -0700 Subject: [PATCH] member removed --- .../app/routes/_dashboard.students.$id.remove.tsx | 3 ++- packages/core/src/infrastructure/bull/bull.types.ts | 1 + packages/core/src/modules/member/events/member-removed.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/admin-dashboard/app/routes/_dashboard.students.$id.remove.tsx b/apps/admin-dashboard/app/routes/_dashboard.students.$id.remove.tsx index 0d0eb8cb..723fdec9 100644 --- a/apps/admin-dashboard/app/routes/_dashboard.students.$id.remove.tsx +++ b/apps/admin-dashboard/app/routes/_dashboard.students.$id.remove.tsx @@ -41,7 +41,7 @@ export async function action({ params, request }: ActionFunctionArgs) { const student = await db .deleteFrom('students') - .returning(['airtableId', 'email', 'slackId']) + .returning(['airtableId', 'email', 'firstName', 'slackId']) .where('id', '=', params.id as string) .executeTakeFirst(); @@ -56,6 +56,7 @@ export async function action({ params, request }: ActionFunctionArgs) { job('student.removed', { airtableId: student.airtableId as string, email: student.email, + firstName: student.firstName, sendViolationEmail, slackId: student.slackId, }); diff --git a/packages/core/src/infrastructure/bull/bull.types.ts b/packages/core/src/infrastructure/bull/bull.types.ts index ee16b5dd..65af8b4f 100644 --- a/packages/core/src/infrastructure/bull/bull.types.ts +++ b/packages/core/src/infrastructure/bull/bull.types.ts @@ -550,6 +550,7 @@ export const StudentBullJob = z.discriminatedUnion('name', [ data: z.object({ airtableId: z.string().trim().min(1), email: Student.shape.email, + firstName: z.string().trim().min(1), sendViolationEmail: z.boolean(), slackId: Student.shape.slackId.nullable(), }), diff --git a/packages/core/src/modules/member/events/member-removed.ts b/packages/core/src/modules/member/events/member-removed.ts index eb3c327d..e497b9fb 100644 --- a/packages/core/src/modules/member/events/member-removed.ts +++ b/packages/core/src/modules/member/events/member-removed.ts @@ -8,6 +8,7 @@ import { export async function onMemberRemoved({ airtableId, email, + firstName, sendViolationEmail, slackId, }: GetBullJobData<'student.removed'>) { @@ -36,7 +37,7 @@ export async function onMemberRemoved({ job('notification.email.send', { to: email, name: 'student-removed', - data: {}, + data: { firstName }, }); } }