Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line no-console
console.warn(
' is deprecated. Use the component instead, via the bulkActionButton props.'
);
}
const {
basePath,
dispatchCrudDeleteMany,
resource,
selectedIds,
startUndoable,
undoable,
} = this.props;
if (undoable) {
startUndoable(crudDeleteMany(resource, selectedIds, basePath));
} else {
dispatchCrudDeleteMany(resource, selectedIds, basePath);
}
this.props.onExit();
};
useEffect(() => {
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line no-console
console.warn(
' is deprecated. Use the component instead, via the bulkActionButton props.'
);
}
const { basePath, resource, selectedIds, undoable, onExit } = props;
if (undoable) {
dispatch(
startUndoable(crudDeleteMany(resource, selectedIds, basePath))
);
} else {
dispatch(crudDeleteMany(resource, selectedIds, basePath));
}
onExit();
}, [dispatch, props]);
handleClick = () => {
const {
basePath,
dispatchCrudDeleteMany,
resource,
selectedIds,
startUndoable,
undoable,
onClick,
} = this.props;
if (undoable) {
startUndoable(crudDeleteMany(resource, selectedIds, basePath));
} else {
dispatchCrudDeleteMany(resource, selectedIds, basePath);
}
if (typeof onClick === 'function') {
onClick();
}
};
handleClick = () => {
const {
basePath,
resource,
selectedIds,
startUndoable,
onClick,
} = this.props;
startUndoable(crudDeleteMany(resource, selectedIds, basePath));
if (typeof onClick === 'function') {
onClick();
}
};