diff --git a/src/app/dashboard/[subdomain]/editor/page.tsx b/src/app/dashboard/[subdomain]/editor/page.tsx index 3c55f0a3..c064ebbb 100644 --- a/src/app/dashboard/[subdomain]/editor/page.tsx +++ b/src/app/dashboard/[subdomain]/editor/page.tsx @@ -235,15 +235,22 @@ export default function SubdomainEditor() { delStorage(`draft-${page.data.characterId}-${page.data.draftKey}`) } else { // Is Note - return deleteP.mutateAsync({ - site: subdomain, - id: `${page.data.characterId}-${page.data.noteId}`, + return deleteP.mutate({ + noteId: page.data.noteId, characterId: page.data.characterId, }) } } } + useEffect(() => { + if (deleteP.isSuccess) { + toast.success(t("Deleted!")) + deleteP.reset() + router.push(`/dashboard/${subdomain}/${searchParams?.get("type")}s`) + } + }, [deleteP.isSuccess]) + const [isCheersOpen, setIsCheersOpen] = useState(false) useEffect(() => { @@ -561,7 +568,8 @@ export default function SubdomainEditor() { {t("Preview")} void + savePage: () => void + deletePage: () => void published: boolean isSaving: boolean isDisabled: boolean @@ -50,7 +52,7 @@ export const PublishButton = ({