Skip to content

Commit ec36704

Browse files
fix array formdata
1 parent 656f79d commit ec36704

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { Appwrite } from "appwrite";
3333
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
3434

3535
```html
36-
<script src="https://cdn.jsdelivr.net/npm/[email protected].2"></script>
36+
<script src="https://cdn.jsdelivr.net/npm/[email protected].3"></script>
3737
```
3838

3939

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "appwrite",
33
"homepage": "https://appwrite.io/support",
44
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5-
"version": "4.0.2",
5+
"version": "4.0.3",
66
"license": "BSD-3-Clause",
77
"main": "dist/cjs/sdk.js",
88
"exports": {
@@ -25,7 +25,7 @@
2525
},
2626
"devDependencies": {
2727
"@rollup/plugin-typescript": "8.2.5",
28-
"playwright": "1.14.1",
28+
"playwright": "1.15.0",
2929
"rollup": "2.56.3",
3030
"serve-handler": "6.1.3",
3131
"tslib": "2.3.1",

src/sdk.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Appwrite {
8787
locale: '',
8888
};
8989
headers: Headers = {
90-
'x-sdk-version': 'appwrite:web:4.0.2',
90+
'x-sdk-version': 'appwrite:web:4.0.3',
9191
'X-Appwrite-Response-Format': '0.10.0',
9292
};
9393

@@ -374,7 +374,9 @@ class Appwrite {
374374

375375
for (const key in params) {
376376
if (Array.isArray(params[key])) {
377-
formData.append(key + '[]', params[key].join(','));
377+
params[key].forEach((value: any) => {
378+
formData.append(key + '[]', value);
379+
})
378380
} else {
379381
formData.append(key, params[key]);
380382
}

0 commit comments

Comments
 (0)