Skip to content

Commit

Permalink
Multi-service direct uploads in Action Text attachment uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcgibbon committed Nov 15, 2021
1 parent 27f17b9 commit 0b69ad4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion actiontext/app/javascript/actiontext/attachment_upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export class AttachmentUpload {
constructor(attachment, element) {
this.attachment = attachment
this.element = element
this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this)
this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this.directUploadToken, this.attachmentName, this)
}

start() {
Expand Down Expand Up @@ -42,4 +42,11 @@ export class AttachmentUpload {
get blobUrlTemplate() {
return this.element.dataset.blobUrlTemplate
}

get directUploadToken() {
return this.element.getAttribute("data-direct-upload-token");
}
get attachmentName() {
return this.element.getAttribute("data-direct-upload-attachment-name");
}
}

0 comments on commit 0b69ad4

Please sign in to comment.