File tree Expand file tree Collapse file tree 5 files changed +11
-4
lines changed
library/src/main/java/io/appwrite Expand file tree Collapse file tree 5 files changed +11
-4
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 *
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments