Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for delete #4840

Merged
merged 1 commit into from
May 21, 2020
Merged

Conversation

bmihelac
Copy link
Contributor

id of deleted record is required in selectedIdsReducer.

https://github.com/marmelab/react-admin/blob/master/packages/ra-core/src/reducer/admin/resource/list/selectedIds.ts#L51

Returning null as documentation stated, would raise Error:

index.js:1 TypeError: Cannot read property 'id' of null
    at selectedIdsReducer (selectedIds.js:19)
    at combination (redux.js:459)
    at index.js:46
    at Array.reduce (<anonymous>)
    at index.js:40
    at combination (redux.js:459)
    at combination (redux.js:459)
    at resettableAppReducer (createAdminStore.js:50)
    at dispatch (redux.js:213)
    at middleware.js:22
    at redux-saga-core.esm.js:1410
    at useDataProvider.js:291

`id` of deleted record is required in `selectedIdsReducer`.

https://github.com/marmelab/react-admin/blob/master/packages/ra-core/src/reducer/admin/resource/list/selectedIds.ts#L51

Returning null as documentation stated, would raise Error:

```
index.js:1 TypeError: Cannot read property 'id' of null
    at selectedIdsReducer (selectedIds.js:19)
    at combination (redux.js:459)
    at index.js:46
    at Array.reduce (<anonymous>)
    at index.js:40
    at combination (redux.js:459)
    at combination (redux.js:459)
    at resettableAppReducer (createAdminStore.js:50)
    at dispatch (redux.js:213)
    at middleware.js:22
    at redux-saga-core.esm.js:1410
    at useDataProvider.js:291
```
@fzaninotto fzaninotto merged commit c8ac2f2 into marmelab:master May 21, 2020
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the 3.5.3 milestone May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants