changed ui package

This commit is contained in:
PxlLoewe
2025-03-07 14:42:34 -07:00
parent 829e78a47d
commit 6fc20a66ef
5 changed files with 64 additions and 37 deletions

View File

@@ -0,0 +1,41 @@
import { Event, Participant, prisma, User } from "@repo/db";
export const handleParticipantFinished = async (
event: Event,
participant: Participant,
user: User,
) => {
const discordID = prisma.discordAccount.findFirst({
where: {
userId: user.id,
},
});
prisma.user.update({
where: {
id: user.id,
},
data: {
badges: {
push: event.finishedBadges,
},
permissions: event.finishedPermissions,
},
});
prisma.participant.update({
where: {
id: participant.id,
},
data: {
finished: true,
statusLog: {
push: {
event: "Event finished",
timestamp: new Date(),
user: "system",
},
},
},
});
};