Skip to content

Commit 447c8c1

Browse files
Update: Make body optional for API calls (@W-18130788@) (#117)
* make body optional * update changelog
1 parent 0e539ed commit 447c8c1

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## 1.8.0
4+
* Make request `body` for HTTP endpoint calls optional [#117](https://github.com/SalesforceCommerceCloud/commerce-sdk-core/pull/117/files)
5+
36
## 1.7.0
47

58
* Expose underlying helper function for fetch calls [#110](https://github.com/SalesforceCommerceCloud/commerce-sdk-core/pull/110)

src/base/staticClient.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export async function runFetch(
239239
* @returns Either the Response object or the DTO inside it wrapped in a promise,
240240
* depending upon options.rawResponse
241241
*/
242-
export async function _get(options: SdkFetchOptionsNoBody): Promise<object> {
242+
export async function _get(options: SdkFetchOptions): Promise<object> {
243243
return runFetch("get", options);
244244
}
245245

@@ -251,7 +251,7 @@ export async function _get(options: SdkFetchOptionsNoBody): Promise<object> {
251251
* @returns Either the Response object or the DTO inside it wrapped in a promise,
252252
* depending upon options.rawResponse
253253
*/
254-
export async function _delete(options: SdkFetchOptionsNoBody): Promise<object> {
254+
export async function _delete(options: SdkFetchOptions): Promise<object> {
255255
return runFetch("delete", options);
256256
}
257257

@@ -264,7 +264,7 @@ export async function _delete(options: SdkFetchOptionsNoBody): Promise<object> {
264264
* depending upon options.rawResponse
265265
*/
266266
export async function _patch(
267-
options: SdkFetchOptionsWithBody
267+
options: SdkFetchOptions
268268
): Promise<object> {
269269
return runFetch("patch", options);
270270
}
@@ -277,7 +277,7 @@ export async function _patch(
277277
* @returns Either the Response object or the DTO inside it wrapped in a promise,
278278
* depending upon options.rawResponse
279279
*/
280-
export async function _post(options: SdkFetchOptionsWithBody): Promise<object> {
280+
export async function _post(options: SdkFetchOptions): Promise<object> {
281281
return runFetch("post", options);
282282
}
283283

@@ -289,6 +289,6 @@ export async function _post(options: SdkFetchOptionsWithBody): Promise<object> {
289289
* @returns Either the Response object or the DTO inside it wrapped in a promise,
290290
* depending upon options.rawResponse
291291
*/
292-
export async function _put(options: SdkFetchOptionsWithBody): Promise<object> {
292+
export async function _put(options: SdkFetchOptions): Promise<object> {
293293
return runFetch("put", options);
294294
}

0 commit comments

Comments
 (0)