Skip to content

Commit 4ffd037

Browse files
authored
Merge pull request #1107 from appwrite/add-missing-urisearchparams
fix: add uri searchParams to URL based methods in react native
2 parents d7a7faf + 23d62ad commit 4ffd037

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

templates/react-native/src/services/template.ts.twig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,15 @@ export class {{ service.name | caseUcfirst }} extends Service {
205205

206206
{% endfor %}
207207
const uri = new URL(this.client.config.endpoint + apiPath);
208+
{% for node in method.auth %}
209+
{% for key,header in node|keys %}
210+
payload['{{header|caseLower}}'] = this.client.config.{{header|caseLower}};
211+
212+
{% endfor %}
213+
{% endfor %}
214+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
215+
uri.searchParams.append(key, value);
216+
}
208217

209218
return uri;
210219
}

0 commit comments

Comments
 (0)