CHanged Event admin layout
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Event, Participant, prisma, User } from "@repo/db";
|
||||
import { sendCourseCompletedEmail } from "modules/mail";
|
||||
|
||||
export const handleParticipantFinished = async (
|
||||
event: Event,
|
||||
@@ -11,9 +12,6 @@ export const handleParticipantFinished = async (
|
||||
},
|
||||
});
|
||||
|
||||
//TODO: Send Discord Message
|
||||
//TODO: Send Email
|
||||
|
||||
await prisma.user.update({
|
||||
where: {
|
||||
id: user.id,
|
||||
@@ -22,19 +20,24 @@ export const handleParticipantFinished = async (
|
||||
badges: {
|
||||
push: event.finishedBadges,
|
||||
},
|
||||
permissions: event.finishedPermissions,
|
||||
permissions: {
|
||||
push: event.finishedPermissions,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
//TODO: Send Discord Message
|
||||
await sendCourseCompletedEmail(user.email, user, event);
|
||||
|
||||
await prisma.participant.update({
|
||||
where: {
|
||||
id: participant.id,
|
||||
},
|
||||
data: {
|
||||
finished: true,
|
||||
completetionWorkflowFinished: true,
|
||||
statusLog: {
|
||||
push: {
|
||||
event: "Event finished",
|
||||
event: "Berechtigungen und Badges vergeben",
|
||||
timestamp: new Date(),
|
||||
user: "system",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user