MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / handleDelete

Function handleDelete

apps/cloud/src/routes/app/org.tsx:103–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101 const confirmed = confirmText.trim() === organizationName.trim();
102
103 const handleDelete = async () => {
104 if (!confirmed || deleting) return;
105 setDeleting(true);
106 const exit = await doDelete({
107 payload: { confirmName: confirmText.trim() },
108 reactivityKeys: authWriteKeys,
109 });
110 trackEvent("org_deleted", { success: Exit.isSuccess(exit) });
111 if (Exit.isSuccess(exit)) {
112 // The org (and the caller's session) are gone. A full navigation resets
113 // all app state and lets the auth gate rehydrate to another membership or
114 // the create-org screen.
115 toast.success(`Deleted ${organizationName}`);
116 window.location.href = "/";
117 return;
118 }
119 setDeleting(false);
120 toast.error("Failed to delete organization");
121 };
122
123 return (
124 <section className="mb-2 border-t border-border pt-8">

Callers 1

DangerZoneSectionFunction · 0.70

Calls 2

trackEventFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected