feat: 게시물 답글 등록 기능
This commit is contained in:
@@ -8,7 +8,9 @@ import { PostForm } from "@/widgets/post";
|
||||
import { PostApi, postFormSchema, type PostFormData } from "@/entities/post";
|
||||
import { useAlertStore, useUserStore } from "@/shared/lib";
|
||||
|
||||
function CreatePage({ bbsId }: { bbsId: string }) {
|
||||
function CreatePage({ bbsId, pstNo }: { bbsId: string; pstNo?: string }) {
|
||||
const answerRegisterMode = !!pstNo;
|
||||
|
||||
const router = useRouter();
|
||||
const { userInfo } = useUserStore((state) => state);
|
||||
const { setMessage: alert } = useAlertStore((state) => state);
|
||||
@@ -30,13 +32,16 @@ function CreatePage({ bbsId }: { bbsId: string }) {
|
||||
popupYn: "N",
|
||||
upndFixYn: "N",
|
||||
prdPstgYn: "N",
|
||||
parentPstNo: pstNo ? parseInt(pstNo) : null,
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="card card-border !mt-6">
|
||||
<div className="card-header">
|
||||
<h3 className="text-2xl font-medium text-label">게시글 등록</h3>
|
||||
<h3 className="text-2xl font-medium text-label">
|
||||
{answerRegisterMode ? "답글 등록" : "게시글 등록"}
|
||||
</h3>
|
||||
</div>
|
||||
<PostForm form={form} handleSave={createPost} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user