Skip to content

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

🐛 Fix query after removing unique index

Luke Vella0ed12b91dc5f
diff --git a/apps/web/src/components/discussion/discussion.tsx b/apps/web/src/components/discussion/discussion.tsx
index a151230f1..d8e944ce1 100644
--- a/apps/web/src/components/discussion/discussion.tsx
+++ b/apps/web/src/components/discussion/discussion.tsx
@@ -112,7 +112,7 @@ const Discussion: React.FunctionComponent = () => {
{dayjs(new Date(comment.createdAt)).fromNow()}
</span>
</div>
- {canDelete &&
+ {canDelete && (
<Dropdown
placement="bottom-start"
trigger={<CompactButton icon={DotsHorizontal} />}
@@ -123,12 +123,11 @@ const Discussion: React.FunctionComponent = () => {
onClick={() => {
deleteComment.mutate({
commentId: comment.id,
- pollId,
});
}}
/>
</Dropdown>
- }
+ )}
</div>
<div className="w-fit whitespace-pre-wrap">
<TruncatedLinkify>{comment.content}</TruncatedLinkify>
diff --git a/apps/web/src/server/routers/polls/comments.ts b/apps/web/src/server/routers/polls/comments.ts
index 91a9a005d..2839979bb 100644
--- a/apps/web/src/server/routers/polls/comments.ts
+++ b/apps/web/src/server/routers/polls/comments.ts
@@ -51,17 +51,13 @@ export const comments = router({
delete: publicProcedure
.input(
z.object({
- pollId: z.string(),
commentId: z.string(),
}),
)
- .mutation(async ({ input: { pollId, commentId } }) => {
+ .mutation(async ({ input: { commentId } }) => {
await prisma.comment.delete({
where: {
- id_pollId: {
- id: commentId,
- pollId,
- },
+ id: commentId,
},
});
}),