feat: Activestorage direct upload (#3768)

This commit is contained in:
Tejaswini Chile 2022-01-27 15:57:22 +05:30 committed by GitHub
parent cd6c9a8fe9
commit 69eaf3ff7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 84 additions and 14 deletions

View file

@ -14,12 +14,12 @@ export const buildCreatePayload = ({
let payload;
if (files && files.length !== 0) {
payload = new FormData();
files.forEach(file => {
payload.append('attachments[]', file, file.name);
});
if (message) {
payload.append('content', message);
}
files.forEach(file => {
payload.append('attachments[]', file);
});
payload.append('private', isPrivate);
payload.append('echo_id', echoId);
payload.append('cc_emails', ccEmails);