Skip to content

Commit b87c01b

Browse files
committed
regen
1 parent f562577 commit b87c01b

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

library/src/main/java/io/appwrite/Client.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ class Client @JvmOverloads constructor(
557557
val warnings = response.headers["x-appwrite-warning"]
558558
if (warnings != null) {
559559
warnings.split(";").forEach { warning ->
560-
println("Warning: $warning")
560+
System.err.println("Warning: $warning")
561561
}
562562
}
563563

library/src/main/java/io/appwrite/Query.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ class Query(
151151
*/
152152
fun orderDesc(attribute: String) = Query("orderDesc", attribute).toJson()
153153

154+
/**
155+
* Sort results randomly.
156+
*
157+
* @returns The query string.
158+
*/
159+
fun orderRandom() = Query("orderRandom").toJson()
160+
154161
/**
155162
* Return results before documentId.
156163
*

library/src/main/java/io/appwrite/models/Document.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ data class Document<T>(
9999
createdAt = map["\$createdAt"] as String,
100100
updatedAt = map["\$updatedAt"] as String,
101101
permissions = map["\$permissions"] as List<String>,
102-
data = map.jsonCast(to = nestedType)
102+
data = map["data"]?.jsonCast(to = nestedType) ?: map.jsonCast(to = nestedType)
103103
)
104104
}
105105
}

library/src/main/java/io/appwrite/models/Preferences.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ data class Preferences<T>(
2929
map: Map<String, Any>,
3030
nestedType: Class<T>
3131
) = Preferences<T>(
32-
data = map.jsonCast(to = nestedType)
32+
data = map["data"]?.jsonCast(to = nestedType) ?: map.jsonCast(to = nestedType)
3333
)
3434
}
3535
}

library/src/main/java/io/appwrite/models/Row.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ data class Row<T>(
9999
createdAt = map["\$createdAt"] as String,
100100
updatedAt = map["\$updatedAt"] as String,
101101
permissions = map["\$permissions"] as List<String>,
102-
data = map.jsonCast(to = nestedType)
102+
data = map["data"]?.jsonCast(to = nestedType) ?: map.jsonCast(to = nestedType)
103103
)
104104
}
105105
}

0 commit comments

Comments
 (0)