@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.
- package/lib/types/base.d.ts +1 -1
- package/lib/utils/api.js +7 -3
- package/package.json +1 -1
package/lib/types/base.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
107
|
+
const requestOptions = {
|
|
108
108
|
method: "DELETE",
|
|
109
109
|
headers: Object.assign({ Authorization: `Bearer ${token}` }, headers),
|
|
110
|
-
|
|
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) {
|