redux-toolkit
redux-toolkit copied to clipboard
How to validate transformed errors with the schema
What should be the errorResponseSchema when the transformErrorResponse is used?
Here is the example of my configuration and there is a type error for the errorResponseSchema however it works in the actual app (sorry, I didn't integrate the actual API into the demo app).
If I will replace it with errorResponseSchema, the TS won't complain but the schema validation will fail with the missing data property.
errorResponseSchema is for after transformation, if any. For validation before transformation, use rawErrorResponseSchema.
Annoyingly our docblocks plugin seems to be acting up, so the docs are missing the description for that property.