Open amy-fang opened 1 month ago
Start a new pull request in StackBlitz Codeflow.
Hey @amy-fang, can you share a link to the StackBlitz example I believe you've already created?
Hey @amy-fang, can you share a link to the StackBlitz example I believe you've already created?
https://stackblitz.com/edit/hey-api-client-axios-example-febun4?file=src%2FApp.tsx
I found that cause this part.
const response = await _axios({
...opts,
data: opts.body,
params: opts.query,
url,
});
let { data } = response;
if (opts.responseType === 'json' && opts.responseTransformer) {
data = await opts.responseTransformer(data);
}
return {
...response,
data: data ?? {},
};
Always return with data. Is there an easy way to package the response data? I want to handler the response data in a global function. But now the axios interceptors don't seem to be the right way.
Description
I used
interceptors.response.use
to return data. When I usedPromise.allSettled
, it always add en empty data in my response data. The client is '@hey-api/client-axios'. See screenshot.Reproducible example or configuration
OpenAPI specification (optional)
No response
System information (optional)
No response