-
When I dispatch an post request, it returns data {"code":401,"message":".....","result":null} with status 401 I expected to get response data from onError, but undefined is returned from onSuccess. In this case how to get response data from onError? useQuery(['worklist', query], getPatientListApi, {
onSuccess: (data) => {
console.log(data) // "undefined"
return data
},
onError: (err) => {
console.log('err', err)
},
retry: 0,
}) |
Beta Was this translation helpful? Give feedback.
Answered by
qkreltms
Aug 12, 2020
Replies: 1 comment
-
It was because of this // axios interceptors
instance.interceptors.response.use(undefined, (error) => { } When I deleted this it works what I expected
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
qkreltms
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It was because of this
When I deleted this it works what I expected