From fa5119a116e9329c284fc92c8501c29e319322c1 Mon Sep 17 00:00:00 2001 From: Nihal Bhatnagar Date: Fri, 8 Nov 2024 13:09:13 -0500 Subject: [PATCH] Fixe for AttachmentUpload in react browser context (#957) (#967) * Fix attachment upload * changeset --- .changeset/rare-jobs-attend.md | 5 +++++ packages/client/src/object/AttachmentUpload.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/rare-jobs-attend.md diff --git a/.changeset/rare-jobs-attend.md b/.changeset/rare-jobs-attend.md new file mode 100644 index 000000000..75c31e9a4 --- /dev/null +++ b/.changeset/rare-jobs-attend.md @@ -0,0 +1,5 @@ +--- +"@osdk/client": patch +--- + +Fixes AttachmentUpload for browser contexts diff --git a/packages/client/src/object/AttachmentUpload.ts b/packages/client/src/object/AttachmentUpload.ts index 7bce7996b..50b778146 100644 --- a/packages/client/src/object/AttachmentUpload.ts +++ b/packages/client/src/object/AttachmentUpload.ts @@ -24,7 +24,11 @@ export function createAttachmentUpload( data: Blob, name: string, ): AttachmentUpload { - const attachmentUpload = Object.create(data, { name: { value: name } }); + const attachmentUpload = Object.create(data, { + name: { value: name }, + size: { value: data.size }, + type: { value: data.type }, + }); return attachmentUpload as AttachmentUpload; }