mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-03 00:19:03 +02:00
✨ Soft delete participants (#1193)
This commit is contained in:
parent
8384128246
commit
6df4405cf4
3 changed files with 11 additions and 1 deletions
|
@ -18,6 +18,7 @@ export const participants = router({
|
|||
const participants = await prisma.participant.findMany({
|
||||
where: {
|
||||
pollId,
|
||||
deleted: false,
|
||||
},
|
||||
include: {
|
||||
votes: {
|
||||
|
@ -43,10 +44,14 @@ export const participants = router({
|
|||
}),
|
||||
)
|
||||
.mutation(async ({ input: { participantId } }) => {
|
||||
await prisma.participant.delete({
|
||||
await prisma.participant.update({
|
||||
where: {
|
||||
id: participantId,
|
||||
},
|
||||
data: {
|
||||
deleted: true,
|
||||
deletedAt: new Date(),
|
||||
},
|
||||
});
|
||||
}),
|
||||
add: publicProcedure
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue