Skip to content

Commit 45eeeac

Browse files
authored
Merge pull request #270 from chrishiguto/feature/allow-response-type-data-provider
feat: allow data provider to pass responseType to axios client
2 parents 3b8dc10 + 39d3a8e commit 45eeeac

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/react-data-provider/src/axiosClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const axiosClient: HttpClient = {
3333
params: configs.queryParams,
3434
signal: configs.signal,
3535
...('body' in configs && { data: configs.body }),
36+
responseType: configs?.responseType,
3637
})
3738
.then((response) => {
3839
const { config, data, headers, status } = response;

packages/react-data-provider/src/interfaces/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { AxiosRequestConfig } from 'axios';
1+
import { AxiosRequestConfig, ResponseType } from 'axios';
22

33
export interface RequestParams {
44
uri: string;
55
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH';
66
headers?: Record<string, string>;
77
queryParams?: Record<string, string | string[] | number | undefined>;
8+
responseType?: ResponseType;
89
signal?: AbortSignal;
910
}
1011

0 commit comments

Comments
 (0)