File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const AXIOS_DEPENDENCIES: GeneratorDependency[] = [
2828 values : true ,
2929 syntheticDefaultImport : true ,
3030 } ,
31+ { name : 'AxiosInstance' } ,
3132 { name : 'AxiosRequestConfig' } ,
3233 { name : 'AxiosResponse' } ,
3334 ] ,
@@ -176,7 +177,7 @@ const generateAxiosImplementation = (
176177 } >>(\n ${ toObjectString ( props , 'implementation' ) } ${
177178 isRequestOptions ? `options?: AxiosRequestConfig\n` : ''
178179 } ): Promise<TData> => {${ bodyForm }
179- return axios ${
180+ return axiosInstance ${
180181 isSyntheticDefaultImportsAllowed ? '' : '.default'
181182 } .${ verb } (${ options } );
182183 }
199200 ? `type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n`
200201 : ''
201202}
202- ${ noFunction ? '' : `export const ${ title } = () => {\n` } ` ;
203+ ${ noFunction ? '' : `export const ${ title } = (axiosInstance: AxiosInstance = axios.create() ) => {\n` } ` ;
203204
204205export const generateAxiosFooter : ClientFooterBuilder = ( {
205206 operationNames,
You can’t perform that action at this time.
0 commit comments