feat: app-wide pending-deletion banner + email every org member

This commit is contained in:
Matthew Meszaros
2026-05-24 04:35:57 +00:00
parent 889c6d1835
commit fceeddf5ea
4 changed files with 262 additions and 27 deletions
@@ -1,10 +1,16 @@
import { useQuery } from "@tanstack/react-query";
import getOrganizationDangerZone from "@/lib/api/client/app/dangerzone/getOrganizationDangerZone";
import { useCurrentOrg } from "@/stores/useAppStore";
// Gated on having an org selected — otherwise the endpoint 400s and
// react-query would stamp the cache with a useless error that the
// global banner has to special-case around.
export default function useOrganizationDangerZone() {
const org = useCurrentOrg();
return useQuery({
queryKey: ["dangerzone", "organization"],
queryKey: ["dangerzone", "organization", org?.id ?? null],
queryFn: () => getOrganizationDangerZone(),
staleTime: 30_000,
enabled: !!org,
});
}