mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-23 22:06:22 +02:00
🐛 Fix query after removing unique index
This commit is contained in:
parent
7f9214daa1
commit
0ed12b91dc
2 changed files with 4 additions and 9 deletions
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
});
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue