fixed error, not using createAxiosRetry() when not using register/registerAsync()

This commit is contained in:
ben 2021-12-23 20:11:18 +02:00
parent 995e61e8a7
commit 3e2d961a2e

View file

@ -14,7 +14,7 @@ import {
} from './interfaces';
import axiosRetry from 'axios-retry';
const createAxiosRetry = (config: HttpModuleOptions) => {
const createAxiosRetry = (config?: HttpModuleOptions) => {
const axiosInstance = Axios.create(config);
axiosRetry(axiosInstance, config);
return axiosInstance;
@ -25,7 +25,7 @@ const createAxiosRetry = (config: HttpModuleOptions) => {
HttpService,
{
provide: AXIOS_INSTANCE_TOKEN,
useValue: Axios,
useValue: createAxiosRetry(),
},
],
exports: [HttpService],