Skip to content

Commit

Permalink
Fixe for AttachmentUpload in react browser context (#957) (#967)
Browse files Browse the repository at this point in the history
* Fix attachment upload

* changeset
  • Loading branch information
nihalbhatnagar authored Nov 8, 2024
1 parent 4733ab2 commit fa5119a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rare-jobs-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@osdk/client": patch
---

Fixes AttachmentUpload for browser contexts
6 changes: 5 additions & 1 deletion packages/client/src/object/AttachmentUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit fa5119a

Please sign in to comment.