🐛 Delete all comments when deleting account (#1267)

Signed-off-by: Luke Vella <me@lukevella.com>
This commit is contained in:
Luke Vella 2024-08-22 17:23:02 +01:00 committed by GitHub
parent 550eebdd9a
commit 8d308ef8b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,7 +64,7 @@ export const user = router({
where: { userId: ctx.user.id },
});
await tx.comment.deleteMany({
where: { userId: ctx.user.id },
where: { OR: [{ pollId: { in: pollIds } }, { userId: ctx.user.id }] },
});
await tx.poll.deleteMany({
where: { userId: ctx.user.id },