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
Bug: in the reducer of GET_POSTS_FAILURE the
payload
is always empty and do not contain the server response.Fix: The
apiMiddleware
do not return the server response on failure topromiseMiddleware
. That's why I've addedreturn data
in thecatch
section of theapiMiddleware
and then thepromiseMiddleware
set the type of the actionSUCCESS
orERROR
depending ofresolved.ok