@paro.io/expert-shared-components 1.12.1 → 1.12.2
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.
|
@@ -5,7 +5,7 @@ interface UploadFileParams {
|
|
|
5
5
|
projectId: number;
|
|
6
6
|
documentUploadUrl: string;
|
|
7
7
|
updateClientInvoiceDisputeMutation: any;
|
|
8
|
-
previousFiles: string[];
|
|
8
|
+
previousFiles: string | string[];
|
|
9
9
|
isExpert: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const fileUploader: ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, disputeId, previousFiles, isExpert, }: UploadFileParams) => Promise<boolean>;
|
|
@@ -16,6 +16,7 @@ exports.fileUploader = void 0;
|
|
|
16
16
|
const UploadClient_1 = __importDefault(require("../shared/UploadClient"));
|
|
17
17
|
const utils_1 = require("../shared/utils");
|
|
18
18
|
const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, disputeId, previousFiles, isExpert, }) {
|
|
19
|
+
const documentLinks = previousFiles ? (typeof previousFiles === 'string' ? previousFiles.split(',') : [...previousFiles]) : [];
|
|
19
20
|
try {
|
|
20
21
|
(0, utils_1.showToast)('success', 'Starting Document Upload');
|
|
21
22
|
const uploadClient = new UploadClient_1.default({
|
|
@@ -28,10 +29,7 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
28
29
|
yield uploadClient.triggerMultipartUpload().then((res) => {
|
|
29
30
|
const resParsed = JSON.parse(res);
|
|
30
31
|
const documentLink = resParsed === null || resParsed === void 0 ? void 0 : resParsed.Location;
|
|
31
|
-
|
|
32
|
-
if (previousFiles) {
|
|
33
|
-
documentLinks.push(...previousFiles);
|
|
34
|
-
}
|
|
32
|
+
documentLinks.push(documentLink); // Add the new file to the documentLinks array
|
|
35
33
|
updateClientInvoiceDisputeMutation({
|
|
36
34
|
variables: {
|
|
37
35
|
input: {
|