From e6d5714c1216a18f0ceeb3c69308156957bc9dd2 Mon Sep 17 00:00:00 2001 From: Wanderley Teixeira Date: Sun, 1 Oct 2023 16:14:43 -0300 Subject: [PATCH] feat(upload): inclui a propriedade `url` no evento `upload` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Esta melhoria permite a alteração da `url` no evento `upload`, assim o componente fica compativel com a API de upload do Fluig. Fixes #1825 --- .../components/po-field/po-upload/po-upload-base.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/ui/src/lib/components/po-field/po-upload/po-upload-base.service.ts b/projects/ui/src/lib/components/po-field/po-upload/po-upload-base.service.ts index d0bdec922a..d28069369c 100644 --- a/projects/ui/src/lib/components/po-field/po-upload/po-upload-base.service.ts +++ b/projects/ui/src/lib/components/po-field/po-upload/po-upload-base.service.ts @@ -41,7 +41,8 @@ export class PoUploadBaseService { const filesLength = files.length; const uploadEvent: any = { data: {}, - file: null + file: null, + url: url }; for (let i = 0; i < filesLength; i++) { @@ -57,6 +58,7 @@ export class PoUploadBaseService { tOnUpload.emit(uploadEvent); formData.append('data', JSON.stringify(uploadEvent.data)); + url = uploadEvent.url; } this.sendFile(url, file, headers, formData, uploadCallback, successCallback, errorCallback);