anorudes / redux-easy-boilerplate

React redux easy boilerplate
MIT License
632 stars 122 forks source link

Bugfix/failed actions has no server error #87

Closed Ouadie closed 8 years ago

Ouadie commented 8 years ago

Bug: in the reducer of GET_POSTS_FAILURE the payloadis always empty and do not contain the server response.

Fix: The apiMiddleware do not return the server response on failure to promiseMiddleware. That's why I've added return data in the catch section of the apiMiddleware and then the promiseMiddleware set the type of the action SUCCESS or ERROR depending of resolved.ok

anorudes commented 8 years ago

@Ouadie, nice catch, thanks!