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.

948 B
Raw Blame
import { useMutation } from "@tanstack/react-query";
import importGithubIssues from "@/fetchers/github-integration/import-github-issues";
import queryClient from "@/query-client";

function useImportGithubIssues() {
  return useMutation({
    mutationFn: importGithubIssues,
    onSettled: async (_data, _error, variables) => {
      // A failed request can follow successfully persisted pages.
      await Promise.all([
        queryClient.invalidateQueries({ queryKey: ["tasks"] }),
        queryClient.invalidateQueries({ queryKey: ["labels"] }),
        queryClient.invalidateQueries({ queryKey: ["projects"] }),
        queryClient.invalidateQueries({ queryKey: ["assigned-tasks"] }),
        queryClient.invalidateQueries({ queryKey: ["workspace-activity"] }),
        queryClient.invalidateQueries({
          queryKey: ["github-integration", variables.projectId],
        }),
      ]);
    },
  });
}

export default useImportGithubIssues;