From 1415fbe5367c7cd8f7f9d205600b3b259a00ed95 Mon Sep 17 00:00:00 2001 From: Choi siun Date: Sun, 18 Aug 2024 05:41:51 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=82=AD=EC=A0=9C=20api=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/editor/navigation.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/editor/navigation.tsx b/src/components/editor/navigation.tsx index 53c9c94..b466cb7 100644 --- a/src/components/editor/navigation.tsx +++ b/src/components/editor/navigation.tsx @@ -13,7 +13,7 @@ import { Undo2, } from "lucide-react"; import Link from "next/link"; -import { useParams } from "next/navigation"; +import { useParams, useRouter } from "next/navigation"; import { toast } from "sonner"; import { useEditor } from "~/components/editor/provider"; import TitleInput from "~/components/editor/title-input"; @@ -28,11 +28,15 @@ import { } from "~/components/ui/dropdown-menu"; import { Tabs, TabsList, TabsTrigger } from "~/components/ui/tabs"; import TooltipSimple from "~/components/ui/tooltip-simple"; -import { updateInvitation } from "~/lib/db/schema/invitations.query"; +import { + deleteInvitation, + updateInvitation, +} from "~/lib/db/schema/invitations.query"; import { cn } from "~/lib/utils"; export default function EditorNavigation() { const { editor, dispatch } = useEditor(); + const router = useRouter(); const { openDialog } = useAlertDialogStore(); const params = useParams(); const subDomain = params.subdomain; @@ -70,7 +74,10 @@ export default function EditorNavigation() { description: "이 작업을 되돌릴 수 없습니다.", confirmText: "확인", cancelText: "취소", - onConfirm: () => {}, + onConfirm: async () => { + await deleteInvitation(editor.config.invitationId); + router.replace("/dashboard"); + }, }); };