Skip to content

Commit d46b6ce

Browse files
committed
feat: fix bug in GET requests
1 parent 5f4370c commit d46b6ce

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

templates/android/library/src/main/java/io/appwrite/Client.kt.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,13 @@ class Client @JvmOverloads constructor(
208208
return@forEach
209209
}
210210
is List<*> -> {
211-
httpBuilder.addQueryParameter(it.key + "[]", it.value.toString())
211+
val list = it.value as List<*>
212+
for (index in list.indices) {
213+
httpBuilder.addQueryParameter(
214+
"${it.key}[]",
215+
list[index].toString()
216+
)
217+
}
212218
}
213219
else -> {
214220
httpBuilder.addQueryParameter(it.key, it.value.toString())

templates/kotlin/src/main/kotlin/io/appwrite/Client.kt.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,13 @@ class Client @JvmOverloads constructor(
184184
return@forEach
185185
}
186186
is List<*> -> {
187-
httpBuilder.addQueryParameter(it.key + "[]", it.value.toString())
187+
val list = it.value as List<*>
188+
for (index in list.indices) {
189+
httpBuilder.addQueryParameter(
190+
"${it.key}[]",
191+
list[index].toString()
192+
)
193+
}
188194
}
189195
else -> {
190196
httpBuilder.addQueryParameter(it.key, it.value.toString())

0 commit comments

Comments
 (0)