Skip to content

Commit

Permalink
feat: 삭제 api 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
xilucks committed Aug 17, 2024
1 parent 129d5f0 commit 1415fbe
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/editor/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Expand Down Expand Up @@ -70,7 +74,10 @@ export default function EditorNavigation() {
description: "이 작업을 되돌릴 수 없습니다.",
confirmText: "확인",
cancelText: "취소",
onConfirm: () => {},
onConfirm: async () => {
await deleteInvitation(editor.config.invitationId);
router.replace("/dashboard");
},
});
};

Expand Down

0 comments on commit 1415fbe

Please sign in to comment.