Skip to content

Commit 9246f77

Browse files
committed
Update sendRequest.hbs
1 parent 70167b0 commit 9246f77

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/templates/core/axios/sendRequest.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
async function sendRequest(
1+
const sendRequest = async <T>(
22
options: ApiRequestOptions,
33
url: string,
44
formData: FormData | undefined,
55
body: any,
66
headers: Record<string, string>,
77
onCancel: OnCancel,
88
openApiConfig: OpenAPIConfig2
9-
): Promise<AxiosResponse<any>> {
9+
): Promise<AxiosResponse<T>> => {
1010
const source = axios.CancelToken.source();
1111
const newUrl = openApiConfig.edge ? url.replace("{edge}", openApiConfig.edge) : url;
1212

13-
const config: AxiosRequestConfig = {
13+
const requestConfig: AxiosRequestConfig = {
1414
url: newUrl,
1515
headers,
16-
data: body || formData,
16+
data: body ?? formData,
1717
method: options.method,
1818
cancelToken: source.token,
1919
validateStatus: () => true,

0 commit comments

Comments
 (0)