Daniel
02/07/2024, 11:33 PMsuspend fun getRestaurantsProcessedOrdersWithThrowAndroid(): CommonFlow<List<ProcessedOrder>> {
realm.syncSession.downloadAllServerChanges()
val userId = appService.currentUser
if(appService.currentUser != null) {
val restaurantsIds = realm.query<Restaurant>("userID = $0", userId!!.id).find().map { it.getID() }
val queryValues = restaurantsIds.joinToString(separator = ",", prefix = "{", postfix = "}")
return realm.query<ProcessedOrder>(
"restaurantID IN $0", queryValues
).asFlow()
.map {
it.list
}.asCommonFlow()
}
else{
throw Exception("user not logged in")
}
}
I have tried with listOf("id,"id","id")...
Do you know why?ephemient
02/08/2024, 12:53 AMPlease refrain from crossposting the same message on multiple channels. It is considered spamming.
Pablichjenkov
02/08/2024, 3:56 AM