feat(http-client): support async beforeRequest interceptors

This commit is contained in:
Ali BARIN
2024-07-27 13:02:00 +00:00
parent 52c0c5e0c5
commit be4493710f
3 changed files with 9 additions and 8 deletions

View File

@@ -33,7 +33,7 @@ export default function createHttpClient({ $, baseURL, beforeRequest = [] }) {
},
{
requestInterceptor: beforeRequest.map((originalBeforeRequest) => {
return (requestConfig) => originalBeforeRequest($, requestConfig);
return async (requestConfig) => await originalBeforeRequest($, requestConfig);
}),
responseErrorInterceptor: interceptResponseError,
}