Skip to content

Commit 496c6b5

Browse files
committed
feat: enhance CommentSection component with resource type and ID props
fix: increase maximum comment body length to 5000 characters
1 parent 3f72f45 commit 496c6b5

File tree

4 files changed

+135
-357
lines changed

4 files changed

+135
-357
lines changed

src/app/[username]/[articleHandle]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const Page: NextPage<ArticlePageProps> = async ({ params }) => {
159159
<div className="mx-auto content-typography">{parsedHTML}</div>
160160
</div>
161161

162-
<CommentSection />
162+
<CommentSection resource_type="ARTICLE" resource_id={article.id} />
163163
</HomepageLayout>
164164
</>
165165
);

src/backend/services/comment.action.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use server";
2+
13
import z from "zod";
24
import { CommentActionInput } from "./inputs/comment.input";
35
import { authID } from "./session.actions";

src/backend/services/inputs/comment.input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const CommentActionInput = {
88
create: z.object({
99
resource_id: z.string().uuid(),
1010
resource_type: z.enum(["ARTICLE", "COMMENT"]),
11-
body: z.string().min(1).max(500),
11+
body: z.string().min(1).max(5000),
1212
}),
1313
update: z.object({
1414
id: z.string().uuid(),

0 commit comments

Comments
 (0)