Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

622 B
Raw Blame
import type { QueryClient } from "@tanstack/react-query";
import { ADMIN_WORKSPACES_QUERY_KEY } from "@/hooks/queries/admin/use-admin-workspaces";
import { authClient } from "@/lib/auth-client";

/**
 * After an archive, restore, or delete: refresh the admin directory and the
 * administrator's own workspace switcher, which may include the workspace.
 */
export function refreshAfterWorkspaceLifecycle(queryClient: QueryClient) {
  void queryClient.invalidateQueries({ queryKey: ADMIN_WORKSPACES_QUERY_KEY });
  void queryClient.invalidateQueries({ queryKey: ["workspaces"] });
  authClient.$store.notify("$listOrg");
}