Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♻️ Drop the participant soft-delete filters from poll reads (#3193)

Luke Vella6b30747ef624
diff --git a/apps/web/src/features/poll/data.ts b/apps/web/src/features/poll/data.ts
index e248e2b30..8238a338f 100644
--- a/apps/web/src/features/poll/data.ts
+++ b/apps/web/src/features/poll/data.ts
@@ -63,9 +63,7 @@ export async function getPollResults({
},
_count: {
select: {
- participants: {
- where: { deleted: false },
- },
+ participants: true,
},
},
},
@@ -74,7 +72,6 @@ export async function getPollResults({
by: ["optionId", "type"],
where: {
pollId,
- participant: { deleted: false },
},
_count: true,
}),
@@ -157,7 +154,6 @@ export async function getPollParticipants({
select: {
id: true,
participants: {
- where: { deleted: false },
select: {
id: true,
name: true,
@@ -225,9 +221,7 @@ export async function listPolls({
},
_count: {
select: {
- participants: {
- where: { deleted: false },
- },
+ participants: true,
},
},
},
@@ -465,7 +459,7 @@ export async function getParticipant({
participantId: string;
}) {
return prisma.participant.findFirst({
- where: { id: participantId, deleted: false },
+ where: { id: participantId },
select: { id: true, pollId: true, userId: true },
});
}
@@ -494,7 +488,6 @@ export async function listParticipantIdsByToken({
where: {
pollId,
userId: payload.userId,
- deleted: false,
email: { not: null },
},
select: { id: true },
@@ -503,7 +496,7 @@ export async function listParticipantIdsByToken({
}
const participant = await prisma.participant.findFirst({
- where: { pollId, token, deleted: false },
+ where: { pollId, token },
select: { id: true },
});
return participant ? [participant.id] : [];
diff --git a/apps/web/src/features/poll/invite/mutations.ts b/apps/web/src/features/poll/invite/mutations.ts
index 03a4c39e6..c2cb271e0 100644
--- a/apps/web/src/features/poll/invite/mutations.ts
+++ b/apps/web/src/features/poll/invite/mutations.ts
@@ -90,7 +90,6 @@ export async function sendPollInvite({
const participant = await prisma.participant.findFirst({
where: {
pollId,
- deleted: false,
email: { equals: email, mode: "insensitive" },
},
select: { id: true },
diff --git a/apps/web/src/trpc/routers/polls.ts b/apps/web/src/trpc/routers/polls.ts
index e32148b03..39a047b9b 100644
--- a/apps/web/src/trpc/routers/polls.ts
+++ b/apps/web/src/trpc/routers/polls.ts
@@ -577,9 +577,7 @@ export const polls = router({
muted: true,
_count: {
select: {
- participants: {
- where: { deleted: false },
- },
+ participants: true,
comments: true,
options: true,
},
@@ -888,7 +886,6 @@ export const polls = router({
},
},
participants: {
- where: { deleted: false },
select: {
id: true,
name: true,
diff --git a/apps/web/src/trpc/routers/polls/participants.ts b/apps/web/src/trpc/routers/polls/participants.ts
index 5831931bf..27dfa2706 100644
--- a/apps/web/src/trpc/routers/polls/participants.ts
+++ b/apps/web/src/trpc/routers/polls/participants.ts
@@ -131,7 +131,6 @@ export const participants = router({
const rawParticipants = await prisma.participant.findMany({
where: {
pollId,
- deleted: false,
},
include: {
votes: {
@@ -305,7 +304,6 @@ export const participants = router({
const participantCount = await prisma.participant.count({
where: {
pollId,
- deleted: false,
},
});