'Redux - AsyncThunk change message to messages in rejected error
I created an asyncThunk like this:
export const myApiCall = createAsyncThunk(
'storeName/myActionType',
async params => {
const response = await myClient.post('/my-path', params)
return response.data
}
)
I have an Axios interceptor with this promise rejection:
return Promise.reject(error.response.data.messages)
With this rejection, the action.error is equal to an empty object in the rejected extraReducer.
So, is it possible to have array messages instead of string message in action.error from rejected extraReducer ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
