@@ -6,6 +6,7 @@ import { revalidatePath } from "next/cache";
|
||||
import { z } from "zod";
|
||||
import { notifyFeedbackAdded, notifyCommentReply } from "@/lib/notifications";
|
||||
import { slackNotifyNewFeedback } from "@/lib/slack";
|
||||
import { createDisplayEvent } from "@/lib/display-events";
|
||||
|
||||
const addCommentSchema = z.object({
|
||||
versionId: z.string().cuid(),
|
||||
@@ -79,6 +80,10 @@ export async function addComment(data: z.infer<typeof addCommentSchema>) {
|
||||
});
|
||||
}
|
||||
|
||||
// Display board event
|
||||
const commenter = await db.user.findUnique({ where: { id: session.user.id }, select: { name: true } });
|
||||
await createDisplayEvent("COMMENT", shotCode, commenter?.name ?? session.user.email ?? "Someone");
|
||||
|
||||
revalidatePath(`/review/${parsed.versionId}`);
|
||||
return { success: true, comment };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user