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

Function handleDelete

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

Source from the content-addressed store, hash-verified

110 const confirmed = confirmText.trim() === organizationName.trim();
111
112 const handleDelete = async () => {
113 if (!confirmed || deleting) return;
114 setDeleting(true);
115 const exit = await doDelete({
116 payload: { confirmName: confirmText.trim() },
117 reactivityKeys: authWriteKeys,
118 });
119 trackEvent("org_deleted", { success: Exit.isSuccess(exit) });
120 if (Exit.isSuccess(exit)) {
121 // The org (and the caller's session) are gone. A full navigation resets
122 // all app state and lets the auth gate rehydrate to another membership or
123 // the create-org screen.
124 toast.success(`Deleted ${organizationName}`);
125 window.location.href = "/";
126 return;
127 }
128 setDeleting(false);
129 toast.error("Failed to delete organization");
130 };
131
132 return (
133 <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