mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-02 02:31:53 +02:00
🐛 Fix can’t delete user with deleted polls (#1405)
This commit is contained in:
parent
501cdd2b56
commit
82eb076c71
3 changed files with 6 additions and 14 deletions
|
@ -70,6 +70,7 @@ export const polls = router({
|
|||
return await prisma.poll.findMany({
|
||||
where: {
|
||||
userId: ctx.user.id,
|
||||
deleted: false,
|
||||
status: input.status === "all" ? undefined : input.status,
|
||||
},
|
||||
orderBy: [
|
||||
|
@ -110,6 +111,7 @@ export const polls = router({
|
|||
const polls = await prisma.poll.findMany({
|
||||
where: {
|
||||
userId: ctx.user.id,
|
||||
deleted: false,
|
||||
status: status === "all" ? undefined : status,
|
||||
},
|
||||
orderBy: [
|
||||
|
|
|
@ -56,7 +56,9 @@ export const user = router({
|
|||
await prisma.$transaction(async (tx) => {
|
||||
const polls = await tx.poll.findMany({
|
||||
select: { id: true },
|
||||
where: { userId: ctx.user.id },
|
||||
where: {
|
||||
userId: ctx.user.id,
|
||||
},
|
||||
});
|
||||
const pollIds = polls.map((poll) => poll.id);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue