@hubs101/js-api-skd-client 1.0.10568 → 1.0.10570

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -551,7 +551,7 @@ export type EventAPIType = {
551
551
  unlikePost: (postId: string) => Promise<Post>;
552
552
  likeComment: (postId: string, commentId: string) => Promise<Post>;
553
553
  unlikeComment: (postId: string, commentId: string) => Promise<Post>;
554
- unlikePostNative: (postId: string, commentId: string) => Promise<Post>;
554
+ unlikePostNative: (postId: string) => Promise<Post>;
555
555
  addComment: (postId: string, body: CommentBody) => Promise<Comment>;
556
556
  addPost: (body: PostBody) => Promise<Post>;
557
557
  addPostNative: (body: FormData) => Promise<Post>;
package/lib/utils/api.js CHANGED
@@ -104,11 +104,15 @@ const deleteRequest = (url, body, token, headers) => __awaiter(void 0, void 0, v
104
104
  ? form.append(key, JSON.stringify(body[key]))
105
105
  : form.append(key, body[key]));
106
106
  }
107
- const response = yield fetch(url, {
107
+ const requestOptions = {
108
108
  method: "DELETE",
109
109
  headers: Object.assign({ Authorization: `Bearer ${token}` }, headers),
110
- body: form.length > 0 ? form : null,
111
- });
110
+ };
111
+ // Only add body if form has content
112
+ if (form && form.length > 0) {
113
+ requestOptions.body = form;
114
+ }
115
+ const response = yield fetch(url, requestOptions);
112
116
  const data = yield response.json();
113
117
  if (String(data.status).startsWith("4")) {
114
118
  if (data === null || data === void 0 ? void 0 : data.message) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubs101/js-api-skd-client",
3
- "version": "1.0.10568",
3
+ "version": "1.0.10570",
4
4
  "author": "Liveware",
5
5
  "scripts": {
6
6
  "test": "jest --config jestconfig.json",