How to use the ra-core.startUndoable function in ra-core

To help you get started, we’ve selected a few ra-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marmelab / react-admin / packages / ra-ui-materialui / src / list / BulkDeleteAction.js View on Github external
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]);
github Kirk-Wang / Blog / react-admin-demo / src / reviews / BulkApproveAction.ts View on Github external
public componentDidMount = () => {
        // const { basePath, startUndoable, resource, selectedIds } = this.props;
        const { basePath, resource, selectedIds } = this.props;
        startUndoable(crudUpdateMany(resource, selectedIds, { status: "accepted" }, basePath));
        this.props.onExit && this.props.onExit();
    };
github Kirk-Wang / Blog / react-admin-demo / src / reviews / BulkRejectAction.ts View on Github external
public componentDidMount = () => {
        const { basePath, resource, selectedIds } = this.props;
        startUndoable(crudUpdateMany(resource, selectedIds, { status: "rejected" }, basePath));
        this.props.onExit && this.props.onExit();
    };