Skip to content

Commit

Permalink
member removed
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiAbdou committed Jul 23, 2024
1 parent 7f96332 commit af05f10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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,
});
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/infrastructure/bull/bull.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}),
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/modules/member/events/member-removed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
export async function onMemberRemoved({
airtableId,
email,
firstName,
sendViolationEmail,
slackId,
}: GetBullJobData<'student.removed'>) {
Expand Down Expand Up @@ -36,7 +37,7 @@ export async function onMemberRemoved({
job('notification.email.send', {
to: email,
name: 'student-removed',
data: {},
data: { firstName },
});
}
}

0 comments on commit af05f10

Please sign in to comment.