refactor: rewrite get execution steps using useExecutionSteps with RQ

This commit is contained in:
Rıdvan Akca
2024-03-11 13:54:37 +03:00
parent 35d8b2e790
commit e68696ccd4
8 changed files with 40 additions and 83 deletions

View File

@@ -0,0 +1,24 @@
import { useQuery } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useExecutionSteps(executionId, page) {
const query = useQuery({
queryKey: ['executionSteps', executionId, page],
queryFn: async ({ payload, signal }) => {
const { data } = await api.get(
`/v1/executions/${executionId}/execution-steps`,
{
params: {
page: page,
},
signal,
},
);
return data;
},
});
return query;
}