refactor: rewrite useStepWithTestExecutions with RQ

This commit is contained in:
Rıdvan Akca
2024-03-25 19:07:30 +03:00
parent ee26b54d54
commit 3632ee77e5
8 changed files with 32 additions and 83 deletions

View File

@@ -0,0 +1,19 @@
import { useQuery } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useStepWithTestExecutions(stepId) {
const query = useQuery({
queryKey: ['stepWithTestExecutions', stepId],
queryFn: async ({ signal }) => {
const { data } = await api.get(`/v1/steps/${stepId}/previous-steps`, {
signal,
});
return data;
},
enabled: false,
});
return query;
}