@@ -58,22 +58,7 @@ import type { OpenAPIConfig } from './OpenAPI';
58
58
59
59
{{> functions/catchErrorCodes }}
60
60
61
- const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
62
- const encoder = config.ENCODE_PATH || encodeURI;
63
-
64
- const path = options.url
65
- .replace('{api-version}', config.VERSION)
66
- .replace(/{(.*?)}/g, (substring: string, group: string) => {
67
- if (options.path?.hasOwnProperty(group)) {
68
- return encoder(String(options.path[group]));
69
- }
70
- return substring;
71
- });
72
-
73
- const url = `${config.BASE}${path}`;
74
-
75
- return url;
76
- };
61
+ {{> functions/getUrl }}
77
62
78
63
79
64
/**
@@ -87,7 +72,7 @@ const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
87
72
export const request = <T >(config: OpenAPIConfig, options: ApiRequestOptions, axiosClient: AxiosInstance = axios): CancelablePromise<T > => {
88
73
return new CancelablePromise(async (resolve, reject, onCancel) => {
89
74
try {
90
- const url = getUrl(config, options);
75
+ const url = getUrl(config, { ... options, query: undefined } );
91
76
const formData = getFormData(options);
92
77
const body = getRequestBody(options);
93
78
const headers = await getHeaders(config, options, formData);
0 commit comments