WIP: 게시글 등록, 수정 작업중

This commit is contained in:
2025-04-30 18:44:00 +09:00
parent 5497a136c9
commit 0b0d567072
12 changed files with 442 additions and 11 deletions
@@ -1,4 +1,4 @@
import { useRouter } from "next/navigation";
import { useRouter, usePathname } from "next/navigation";
import { useMutation } from "@tanstack/react-query";
import { useConfirm } from "@frontend-opensource/use-react-hooks";
import { Button } from "@common/components";
@@ -12,6 +12,8 @@ type PostActionProps = {
function PostAction({ children, bbsId, pstNo }: PostActionProps) {
const router = useRouter();
const pathname = usePathname();
const { confirm } = useConfirm();
const { mutate: deletePost } = useMutation({
@@ -37,7 +39,11 @@ function PostAction({ children, bbsId, pstNo }: PostActionProps) {
>
목록
</Button>
<Button size="lg" type="submit">
<Button
size="lg"
type="button"
onClick={() => router.push(`${pathname}/modify`)}
>
수정
</Button>
<Button size="lg" color="red" type="button" onClick={onDelete}>