feat(flows): add flow filters

This commit is contained in:
Ali BARIN
2025-03-19 16:13:36 +00:00
parent d00c5e166f
commit 3d060df5bd
10 changed files with 275 additions and 34 deletions

View File

@@ -1,12 +1,18 @@
import api from 'helpers/api';
import { useQuery } from '@tanstack/react-query';
export default function useFlows({ flowName, page, folderId }) {
export default function useFlows({
flowName,
page,
folderId,
status,
onlyOwnedFlows,
}) {
const query = useQuery({
queryKey: ['flows', flowName, { page, folderId }],
queryKey: ['flows', { flowName, page, folderId, status, onlyOwnedFlows }],
queryFn: async ({ signal }) => {
const { data } = await api.get('/v1/flows', {
params: { name: flowName, page, folderId },
params: { name: flowName, page, folderId, status, onlyOwnedFlows },
signal,
});