Skip to content

Commit cf92180

Browse files
dhairyadwivediPlopix
authored andcommitted
Update uploadImage.ts
1 parent cbc556a commit cf92180

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "@crystallize/js-api-client",
33
"license": "MIT",
4-
"version": "1.13.0",
4+
"version": "1.13.1",
55
"author": "Crystallize <[email protected]> (https://crystallize.com)",
66
"contributors": [
7-
"Sébastien Morel <[email protected]>"
7+
"Sébastien Morel <[email protected]>",
8+
"Dhairya Dwivedi <[email protected]>"
89
],
910
"scripts": {
1011
"watch": "yarn tsc -W",

src/core/uploadImage.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mutation UPLOAD_FILE ($tenantId: ID!, $filename: String!, $mimeType: String!) {
3232
}
3333
}`;
3434

35-
export async function uploadImageToTenant({
35+
export async function uploadToTenant({
3636
id,
3737
mimeType,
3838
filename,
@@ -55,7 +55,6 @@ export async function uploadImageToTenant({
5555

5656
const response = await fetch(payload.url, {
5757
method: 'POST',
58-
headers: new Headers({ 'Content-Length': String(stats.size) }),
5958
body: formData,
6059
});
6160

@@ -99,7 +98,7 @@ export async function handleImageUpload(
9998
return 'No tenant id provided';
10099
}
101100

102-
const imageKey = await uploadImageToTenant({
101+
const imageKey = await uploadToTenant({
103102
id: tId,
104103
...data,
105104
});

0 commit comments

Comments
 (0)