Skip to content
This repository has been archived by the owner on Aug 16, 2019. It is now read-only.

Fix bug with deleting entities #12

Closed
mikestone14 opened this issue Nov 14, 2017 · 0 comments · Fixed by #19
Closed

Fix bug with deleting entities #12

mikestone14 opened this issue Nov 14, 2017 · 0 comments · Fixed by #19
Labels

Comments

@mikestone14
Copy link
Member

mikestone14 commented Nov 14, 2017

Entities are not being removed from state when the DESTROY_SUCCESS action is dispatched.

  • The reducer handles DESTROY_SUCCESS by replacing they values in data with the current values without the ID of the entity that was destroy. This happens here.

  • The helper method entitiesExceptID treats the action's payload.data as an ID.

  • When the DESTROY_SUCCESS action is dispatched, it received the response from the API as the argument here. This response is then "normalized" and becomes the action's payload.data here. This means that the data will not be the ID of the element that was removed, causing the bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant