Skip to content

Commit 0b69ad4

Browse files
committed
Multi-service direct uploads in Action Text attachment uploads
1 parent 27f17b9 commit 0b69ad4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

actiontext/app/javascript/actiontext/attachment_upload.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export class AttachmentUpload {
44
constructor(attachment, element) {
55
this.attachment = attachment
66
this.element = element
7-
this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this)
7+
this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this.directUploadToken, this.attachmentName, this)
88
}
99

1010
start() {
@@ -42,4 +42,11 @@ export class AttachmentUpload {
4242
get blobUrlTemplate() {
4343
return this.element.dataset.blobUrlTemplate
4444
}
45+
46+
get directUploadToken() {
47+
return this.element.getAttribute("data-direct-upload-token");
48+
}
49+
get attachmentName() {
50+
return this.element.getAttribute("data-direct-upload-attachment-name");
51+
}
4552
}

0 commit comments

Comments
 (0)