|
|
|
@ -90,17 +90,10 @@ class EteBaseClient(
|
|
|
|
suspend fun uploadChanges(collection: Collection, items: List<Item>) {
|
|
|
|
suspend fun uploadChanges(collection: Collection, items: List<Item>) {
|
|
|
|
val itemManager = etebase.collectionManager.getItemManager(collection)
|
|
|
|
val itemManager = etebase.collectionManager.getItemManager(collection)
|
|
|
|
withContext(Dispatchers.IO) {
|
|
|
|
withContext(Dispatchers.IO) {
|
|
|
|
itemManager.batch(items.toTypedArray())
|
|
|
|
itemManager.transaction(items.toTypedArray())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
suspend fun getItem(collection: Collection, uid: String): Item? =
|
|
|
|
|
|
|
|
cache.itemGet(
|
|
|
|
|
|
|
|
etebase.collectionManager.getItemManager(collection),
|
|
|
|
|
|
|
|
collection.uid,
|
|
|
|
|
|
|
|
uid
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
suspend fun logout() {
|
|
|
|
suspend fun logout() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
EtebaseLocalCache.clear(context, username)
|
|
|
|
EtebaseLocalCache.clear(context, username)
|
|
|
|
|