Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
all records
  • Loading branch information
Rishi authored and Rishi committed Nov 26, 2025
commit a601035f58abbc5cea9deb3104786bf2397c17bf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { useQuery } from "@tanstack/react-query";
import { api } from "../../api";
import { getURL } from "../../helpers/constants";
import type { FlowVersionPaginatedResponse } from "./use-get-pending-reviews";

export const useGetAllFlowVersions = (
page: number = 1,
limit: number = 12,
status?: string
) => {
return useQuery<FlowVersionPaginatedResponse>({
queryKey: ["all-flow-versions", page, limit, status],
queryFn: async () => {
const response = await api.get<FlowVersionPaginatedResponse>(
`${getURL("FLOW_VERSIONS")}/all`,
{
params: {
page,
limit,
...(status && status !== "all" ? { status } : {}),
},
}
);
return response.data;
},
staleTime: 0, // Always fetch fresh data
refetchOnMount: "always", // Refetch when component mounts
refetchOnWindowFocus: true,
});
};