mirror of
https://github.com/warmbly/warmbly.git
synced 2026-10-26 16:02:23 +00:00
feat: app-wide pending-deletion banner + email every org member
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user