Closed mgiraldo closed 2 months ago
@carsomyr the response status is fine it should return 422, what we should create is create an interceptor error result in Axios to catch those kinds of errors (422, 401, 404) and handle them.
@renzodiaz Good point! I'll look into the undefined
problem though.
version: 0.9.8
an API call that results in a server error (eg:
422 Unprocessable entity
) will produce avuex-orm-json-api
error that cannot be handled by the application.for example:
await this.$store.$db().model('my_model').jsonApi().create(someInvalidPayload)
produces no
response
object and therefore this line fails:https://github.com/scalient/vuex-orm-json-api/blob/387471dba9baabd52fcc27c24c191f1ab561c2fe/src/json_api/Response.js#L20