@hubs101/js-api-skd-client 1.0.10666 → 1.0.10667
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.
|
@@ -239,7 +239,19 @@ const _createFeed = (basePath, token, accountId, data, files) => __awaiter(void
|
|
|
239
239
|
exports._createFeed = _createFeed;
|
|
240
240
|
const _updateFeed = (basePath, token, accountId, feedId, data, files) => __awaiter(void 0, void 0, void 0, function* () {
|
|
241
241
|
const base = (0, base_1.getBasePath)(basePath);
|
|
242
|
-
const
|
|
242
|
+
const requestUrl = `${base.ACCOUNTS}/${accountId}/feeds/${feedId}`;
|
|
243
|
+
const normalizedFiles = files !== null && files !== void 0 ? files : [];
|
|
244
|
+
const hasBinaryFile = normalizedFiles.some((file) => (file === null || file === void 0 ? void 0 : file.value) && typeof file.value !== "string");
|
|
245
|
+
if ((data === null || data === void 0 ? void 0 : data.webinar_id) === null && !hasBinaryFile) {
|
|
246
|
+
return (0, api_1.putRequestDirect)(requestUrl, token, data);
|
|
247
|
+
}
|
|
248
|
+
if ((data === null || data === void 0 ? void 0 : data.webinar_id) === null && hasBinaryFile) {
|
|
249
|
+
yield (0, api_1.putRequestDirect)(requestUrl, token, data);
|
|
250
|
+
const payloadWithoutWebinarId = Object.assign({}, data);
|
|
251
|
+
delete payloadWithoutWebinarId.webinar_id;
|
|
252
|
+
return (0, api_1.postFilesAndDataRequest)(requestUrl, payloadWithoutWebinarId, normalizedFiles, token, "put");
|
|
253
|
+
}
|
|
254
|
+
const response = yield (0, api_1.postFilesAndDataRequest)(requestUrl, data, normalizedFiles, token, "put");
|
|
243
255
|
return response;
|
|
244
256
|
});
|
|
245
257
|
exports._updateFeed = _updateFeed;
|