Skip to content

Commit

Permalink
feat(upload): inclui a propriedade url no evento upload
Browse files Browse the repository at this point in the history
Esta melhoria permite a alteração da `url` e `headers` no evento
`upload`, assim  o componente fica compativel com a API de upload
do Fluig conforme abaixo:

`url` - Será atualizada para conter o nome do arquivo enviado;
`headers` - No caso de autenticação `OAuth`, será gerado um nova
`Authorization`;

Fixes #1825
  • Loading branch information
wsteixeira authored and rafaellmarques committed Oct 6, 2023
1 parent 79d15f2 commit 6c8a9af
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export class PoUploadBaseService {
const filesLength = files.length;
const uploadEvent: any = {
data: {},
file: null
file: null,
url: url,
headers: headers
};

for (let i = 0; i < filesLength; i++) {
Expand All @@ -57,6 +59,8 @@ export class PoUploadBaseService {
tOnUpload.emit(uploadEvent);

formData.append('data', JSON.stringify(uploadEvent.data));
url = uploadEvent.url;
headers = uploadEvent.headers;
}

this.sendFile(url, file, headers, formData, uploadCallback, successCallback, errorCallback);
Expand Down

0 comments on commit 6c8a9af

Please sign in to comment.