Skip to content

Commit 8aa2266

Browse files
committed
adjusting Slack and Pandadoc
1 parent 0107ed6 commit 8aa2266

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

components/pandadoc/actions/create-document-attachment/create-document-attachment.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ export default {
3131
methods: {
3232
async getFormData(file, fileName) {
3333
const {
34-
stream, metadata: {
35-
name, size,
36-
},
34+
stream, metadata,
3735
} = await getFileStreamAndMetadata(file);
3836
const data = new FormData();
39-
data.append("name", fileName || name);
37+
data.append("name", fileName || metadata.name);
4038
data.append("file", stream, {
41-
knownLength: size,
39+
contentType: metadata.contentType,
40+
knownLength: metadata.size,
41+
filename: metadata.name,
4242
});
4343
return data;
4444
},

components/pandadoc/actions/create-document-from-file/create-document-from-file.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default {
7070
: this.fields;
7171
}
7272

73-
const data = this.getFormData(file);
73+
const data = await this.getFormData(file);
7474
const contentType = `multipart/form-data; boundary=${data._boundary}`;
7575
data.append("data", JSON.stringify(json));
7676

components/slack/actions/upload-file/upload-file.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export default {
5656

5757
// Upload the file to the provided URL
5858
const formData = new FormData();
59-
formData.append("file", stream);
59+
formData.append("file", stream, {
60+
contentType: metadata.contentType,
61+
knownLength: metadata.size,
62+
filename: metadata.name,
63+
});
6064
formData.append("filename", filename);
6165

6266
await axios($, {

0 commit comments

Comments
 (0)