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

@@ -4,6 +4,7 @@ import { useMutation } from '@apollo/client';
import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import { DELETE_STEP } from 'graphql/mutations/delete-step';
import useFormatMessage from 'hooks/useFormatMessage';
import { useQueryClient } from '@tanstack/react-query';
@@ -12,10 +13,7 @@ function FlowStepContextMenu(props) {
const { stepId, onClose, anchorEl, deletable, flowId } = props;
const formatMessage = useFormatMessage();
const queryClient = useQueryClient();
const [deleteStep] = useMutation(DELETE_STEP, {
refetchQueries: ['GetStepWithTestExecutions'],
});
const [deleteStep] = useMutation(DELETE_STEP);
const deleteActionHandler = React.useCallback(
async (event) => {