Add progress indicator and basic uplaod queue

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-04-04 21:24:15 +02:00
parent 6cab67cb11
commit 22fb70f957
5 changed files with 28 additions and 35 deletions

View File

@@ -38,18 +38,10 @@ export class AttachmentApi {
}
async createAttachment({ cardId, formData, onUploadProgress }) {
const config = {
onUploadProgress: function(progressEvent) {
const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
},
}
const response = await axios({
method: 'POST',
url: this.url(`/cards/${cardId}/attachment`),
data: formData,
...config,
onUploadProgress,
})
return response.data