diff --git a/src/index.ts b/src/index.ts index 605ec48..149995f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -140,7 +140,7 @@ export default class AxiosWrapper { } async request(methodParams: ApiMethodParams): Promise { - const {method, url, data = null, params, options = {}, retries = 0} = methodParams; + const {method, url, data = null, params = {}, options = {}, retries = 0} = methodParams; const axiosSettings = options.requestConfig || {}; const {concurrentId, collectRequest = true, timeout, headers, onDownloadProgress} = options; @@ -226,8 +226,8 @@ export default class AxiosWrapper { get( url: string, - params: ApiMethodParams['params'], - options: ApiMethodParams['options'] = {}, + params?: ApiMethodParams['params'], + options?: ApiMethodParams['options'], ) { return this.request({ method: 'GET', @@ -240,8 +240,8 @@ export default class AxiosWrapper { post( url: string, data: unknown, - params: ApiMethodParams['params'], - options: ApiMethodParams['options'] = {}, + params?: ApiMethodParams['params'], + options?: ApiMethodParams['options'], ) { return this.request({ method: 'POST', @@ -255,8 +255,8 @@ export default class AxiosWrapper { put( url: string, data: unknown, - params: ApiMethodParams['params'], - options: ApiMethodParams['options'] = {}, + params?: ApiMethodParams['params'], + options?: ApiMethodParams['options'], ) { return this.request({ method: 'PUT', @@ -270,8 +270,8 @@ export default class AxiosWrapper { patch( url: string, data: unknown, - params: ApiMethodParams['params'], - options: ApiMethodParams['options'] = {}, + params?: ApiMethodParams['params'], + options?: ApiMethodParams['options'], ) { return this.request({ method: 'PATCH', @@ -285,8 +285,8 @@ export default class AxiosWrapper { delete( url: string, data: unknown, - params: ApiMethodParams['params'], - options: ApiMethodParams['options'] = {}, + params?: ApiMethodParams['params'], + options?: ApiMethodParams['options'], ) { return this.request({ method: 'DELETE', @@ -299,8 +299,8 @@ export default class AxiosWrapper { head( url: string, - params: ApiMethodParams['params'], - options: ApiMethodParams['options'] = {}, + params?: ApiMethodParams['params'], + options?: ApiMethodParams['options'], ) { return this.request({ method: 'HEAD',