UsersDao/Repository: get rid of suspend functions

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey 2022-06-30 16:50:20 +02:00 committed by Andy Scherzinger
parent f339648875
commit 0ac26f557b
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 6 additions and 6 deletions

View file

@ -99,7 +99,7 @@ abstract class UsersDao {
}
@Transaction
open suspend fun markUserForDeletion(id: Long): Boolean {
open fun markUserForDeletion(id: Long): Boolean {
getUserWithId(id).blockingGet()?.let { user ->
user.current = FALSE
updateUser(user)
@ -109,7 +109,7 @@ abstract class UsersDao {
}
@Transaction
open suspend fun setAnyUserAsActive(): Boolean {
open fun setAnyUserAsActive(): Boolean {
val users = getUsers().blockingGet()
val result = users.firstOrNull()?.let { user ->

View file

@ -41,6 +41,6 @@ interface UsersRepository {
fun insertUser(user: User): Long
fun setUserAsActiveWithId(id: Long): Single<Boolean>
fun deleteUserWithId(id: Long)
suspend fun setAnyUserAsActive(): Boolean
suspend fun markUserForDeletion(id: Long): Boolean
fun setAnyUserAsActive(): Boolean
fun markUserForDeletion(id: Long): Boolean
}

View file

@ -81,11 +81,11 @@ class UsersRepositoryImpl(private val usersDao: UsersDao) : UsersRepository {
usersDao.deleteUserWithId(id)
}
override suspend fun setAnyUserAsActive(): Boolean {
override fun setAnyUserAsActive(): Boolean {
return usersDao.setAnyUserAsActive()
}
override suspend fun markUserForDeletion(id: Long): Boolean {
override fun markUserForDeletion(id: Long): Boolean {
return usersDao.markUserForDeletion(id)
}
}