fork of hey-api/openapi-ts because I need some additional things

fix(client): use AbortController in axios client

authored by

Jordan Shatford and committed by
Jordan Shatford
b97c78d5 c6ba8ca7

+3 -3
+3 -3
src/templates/core/axios/sendRequest.hbs
··· 8 8 onCancel: OnCancel, 9 9 axiosClient: AxiosInstance 10 10 ): Promise<AxiosResponse<T>> => { 11 - const source = axios.CancelToken.source(); 11 + const controller = new AbortController(); 12 12 13 13 const requestConfig: AxiosRequestConfig = { 14 14 url, ··· 16 16 data: body ?? formData, 17 17 method: options.method, 18 18 withCredentials: config.WITH_CREDENTIALS, 19 - cancelToken: source.token, 19 + signal: controller.signal, 20 20 }; 21 21 22 - onCancel(() => source.cancel('The user aborted a request.')); 22 + onCancel(() => controller.abort()); 23 23 24 24 try { 25 25 return await axiosClient.request(requestConfig);