Revert "🔒️ Rate limit comments (#1363)"

This reverts commit 50e4084b76.
This commit is contained in:
Luke Vella 2024-09-28 20:15:04 +01:00
parent c0bc3139a5
commit 941bd811ba
No known key found for this signature in database
GPG key ID: 469CAD687F0D784C
2 changed files with 8 additions and 16 deletions

View file

@ -15,7 +15,6 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@rallly/ui/dropdown-menu";
import { useToast } from "@rallly/ui/hooks/use-toast";
import { Icon } from "@rallly/ui/icon";
import { Input } from "@rallly/ui/input";
import { Textarea } from "@rallly/ui/textarea";
@ -78,6 +77,13 @@ function NewCommentForm({
const queryClient = trpc.useUtils();
const addComment = trpc.polls.comments.add.useMutation({
onSuccess: () => {
queryClient.polls.comments.invalidate();
posthog?.capture("created comment");
},
});
const session = useUser();
const { register, reset, control, handleSubmit, formState } =
@ -87,20 +93,7 @@ function NewCommentForm({
content: "",
},
});
const { toast } = useToast();
const addComment = trpc.polls.comments.add.useMutation({
onSuccess: () => {
queryClient.polls.comments.invalidate();
posthog?.capture("created comment");
},
onError: (error) => {
toast({
title: "Error",
description: error.message,
});
},
});
return (
<form
className="w-full space-y-2.5"

View file

@ -5,12 +5,11 @@ import { absoluteUrl } from "@/utils/absolute-url";
import { getEmailClient } from "@/utils/emails";
import { createToken } from "@/utils/session";
import { publicProcedure, rateLimitMiddleware, router } from "../../trpc";
import { publicProcedure, router } from "../../trpc";
import { DisableNotificationsPayload } from "../../types";
export const comments = router({
list: publicProcedure
.use(rateLimitMiddleware)
.input(
z.object({
pollId: z.string(),