File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
- async function sendRequest(
1
+ const sendRequest = async < T > (
2
2
options: ApiRequestOptions,
3
3
url: string,
4
4
formData: FormData | undefined,
5
5
body: any,
6
6
headers: Record<string , string>,
7
7
onCancel: OnCancel,
8
8
openApiConfig: OpenAPIConfig2
9
- ): Promise<AxiosResponse <any> > {
9
+ ): Promise<AxiosResponse <T>> = > {
10
10
const source = axios.CancelToken.source();
11
11
const newUrl = openApiConfig.edge ? url.replace("{edge}", openApiConfig.edge) : url;
12
12
13
- const config : AxiosRequestConfig = {
13
+ const requestConfig : AxiosRequestConfig = {
14
14
url: newUrl,
15
15
headers,
16
- data: body || formData,
16
+ data: body ?? formData,
17
17
method: options.method,
18
18
cancelToken: source.token,
19
19
validateStatus: () => true,
You can’t perform that action at this time.
0 commit comments