(...args: Parameters<typeof apiInstance.get>)
| 5 | const apiInstance = apiFactory(); |
| 6 | |
| 7 | export async function get<T>(...args: Parameters<typeof apiInstance.get>) { |
| 8 | // Note: we are passing AxiosResponseData as the second type argument to set the default type of the response data.The reason |
| 9 | // is we modify the response data in the responseSuccessInterceptor to return `.data` property from the axios response so that we can |
| 10 | // just `response.data` instead of `response.data.data`. So we have to make sure that the response data's type matches what we do in the interceptor. |
| 11 | return apiInstance.get<T, AxiosResponseData<T>>(...args); |
| 12 | } |
| 13 | |
| 14 | export async function post<T>(...args: Parameters<typeof apiInstance.post>) { |
| 15 | return apiInstance.post<T, AxiosResponseData<T>>(...args); |
no test coverage detected