File tree 2 files changed +11
-8
lines changed
2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -65,17 +65,18 @@ export const callCustomEndpoint = async (
65
65
}
66
66
} ) ;
67
67
68
- const defaultBaseUri = 'https://{shortCode}.api.commercecloud.salesforce.com/custom/{apiName}/{apiVersion}'
69
- let clientConfigCopy = clientConfig
70
-
71
- if ( ! clientConfig . baseUri || ! clientConfig . parameters ?. apiVersion ) {
68
+ const defaultBaseUri =
69
+ 'https://{shortCode}.api.commercecloud.salesforce.com/custom/{apiName}/{apiVersion}' ;
70
+ let clientConfigCopy = clientConfig ;
71
+
72
+ if ( ! clientConfig . baseUri || ! clientConfig . parameters ?. apiVersion ) {
72
73
clientConfigCopy = {
73
74
...clientConfig ,
74
- ...( ! clientConfig . baseUri && { baseUri : defaultBaseUri } ) ,
75
+ ...( ! clientConfig . baseUri && { baseUri : defaultBaseUri } ) ,
75
76
parameters : {
76
77
...clientConfig . parameters ,
77
- ...( ! clientConfig . parameters ?. apiVersion && { apiVersion : 'v1' } )
78
- }
78
+ ...( ! clientConfig . parameters ?. apiVersion && { apiVersion : 'v1' } ) ,
79
+ } ,
79
80
} ;
80
81
}
81
82
Original file line number Diff line number Diff line change @@ -46,7 +46,9 @@ export const doFetch = async <Params extends BaseUriParameters>(
46
46
const requestOptions : FetchOptions = {
47
47
...clientConfig ?. fetchOptions ,
48
48
headers,
49
- body : options ?. body as ( BodyInit & ( globalThis . BodyInit | null ) ) | undefined ,
49
+ body : options ?. body as
50
+ | ( BodyInit & ( globalThis . BodyInit | null ) )
51
+ | undefined ,
50
52
method : options ?. method ?? 'GET' ,
51
53
} ;
52
54
You can’t perform that action at this time.
0 commit comments