@webitel/api-services 26.12.32 → 26.12.33
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/package.json
CHANGED
|
@@ -139,7 +139,15 @@ export const getMediaUrl = (
|
|
|
139
139
|
);
|
|
140
140
|
|
|
141
141
|
/** [Claude] All files in one request, one notification; fields named `file[n]` as the old dropzone upload sent them */
|
|
142
|
-
const uploadMedia = async (
|
|
142
|
+
const uploadMedia = async (
|
|
143
|
+
files: File[],
|
|
144
|
+
{
|
|
145
|
+
// [Claude] callers showing their own success toast (e.g. the media import, WTEL-10817) turn it off
|
|
146
|
+
notifySuccess = true,
|
|
147
|
+
}: {
|
|
148
|
+
notifySuccess?: boolean;
|
|
149
|
+
} = {},
|
|
150
|
+
) => {
|
|
143
151
|
const formData = new FormData();
|
|
144
152
|
files.forEach((file, index) => {
|
|
145
153
|
formData.append(`file[${index}]`, file);
|
|
@@ -147,6 +155,7 @@ const uploadMedia = async (files: File[]) => {
|
|
|
147
155
|
|
|
148
156
|
try {
|
|
149
157
|
const response = await instance.post('/storage/media', formData);
|
|
158
|
+
if (!notifySuccess) return response.data;
|
|
150
159
|
return applyTransform(response.data, [
|
|
151
160
|
notify(({ callback }) =>
|
|
152
161
|
callback({
|
|
@@ -483,10 +483,13 @@ const addMembersBulk = async ({
|
|
|
483
483
|
parentId,
|
|
484
484
|
fileName,
|
|
485
485
|
items,
|
|
486
|
+
// [Claude] imports save in chunks and show one "imported" toast themselves, so they turn it off (WTEL-10817)
|
|
487
|
+
notifySuccess = true,
|
|
486
488
|
}: {
|
|
487
489
|
parentId: ApiId;
|
|
488
490
|
fileName: string;
|
|
489
491
|
items: ApiParams[];
|
|
492
|
+
notifySuccess?: boolean;
|
|
490
493
|
}) => {
|
|
491
494
|
const body = {
|
|
492
495
|
parentId,
|
|
@@ -498,6 +501,11 @@ const addMembersBulk = async ({
|
|
|
498
501
|
String(parentId),
|
|
499
502
|
body,
|
|
500
503
|
);
|
|
504
|
+
if (!notifySuccess) {
|
|
505
|
+
return applyTransform(response.data, [
|
|
506
|
+
snakeToCamel(doNotConvertKeys),
|
|
507
|
+
]);
|
|
508
|
+
}
|
|
501
509
|
return applyTransform(response.data, [
|
|
502
510
|
snakeToCamel(doNotConvertKeys),
|
|
503
511
|
notify(({ callback }: ApiParams) =>
|