refactor(Flows): utilize useQuery over useMutation

This commit is contained in:
Ali BARIN
2025-01-20 15:38:21 +00:00
parent 08c1abe193
commit b237b2a2bc
7 changed files with 26 additions and 75 deletions

View File

@@ -16,8 +16,7 @@ import useExportFlow from 'hooks/useExportFlow';
import useDownloadJsonAsFile from 'hooks/useDownloadJsonAsFile';
function ContextMenu(props) {
const { flowId, onClose, anchorEl, onDuplicateFlow, onDeleteFlow, appKey } =
props;
const { flowId, onClose, anchorEl, onDuplicateFlow, appKey } = props;
const enqueueSnackbar = useEnqueueSnackbar();
const formatMessage = useFormatMessage();
const queryClient = useQueryClient();
@@ -67,14 +66,12 @@ function ContextMenu(props) {
variant: 'success',
});
onDeleteFlow?.();
onClose();
}, [
deleteFlow,
appKey,
enqueueSnackbar,
formatMessage,
onDeleteFlow,
onClose,
queryClient,
]);
@@ -143,7 +140,6 @@ ContextMenu.propTypes = {
PropTypes.func,
PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
]).isRequired,
onDeleteFlow: PropTypes.func,
onDuplicateFlow: PropTypes.func,
appKey: PropTypes.string,
};