Skip to content

Commit 5533ed4

Browse files
committed
- Fixed typescript compile issue
1 parent 1e410e7 commit 5533ed4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/templates/core/axios/request.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{>header}}
22

3-
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
3+
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
44
import Blob from 'cross-blob'
55
import FormData from 'form-data';
66

src/templates/core/axios/sendRequest.hbs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ async function sendRequest(
2222
try {
2323
return await axios.request(config);
2424
} catch (error) {
25-
if (error.response) {
26-
return error.response;
25+
const axiosError = error as AxiosError;
26+
if (axiosError.response) {
27+
return axiosError.response;
2728
}
2829
throw error;
2930
}

0 commit comments

Comments
 (0)