Cleaner API

This commit is contained in:
Benoit Marty 2019-08-05 14:47:16 +02:00
parent 394b89e76b
commit dafdc1d3ad
2 changed files with 2 additions and 3 deletions

View File

@ -27,7 +27,7 @@ internal interface SessionParamsStore {

fun getAll(): List<SessionParams>

fun save(sessionParams: SessionParams): Try<SessionParams>
fun save(sessionParams: SessionParams): Try<Unit>

fun delete(userId: String): Try<Unit>


View File

@ -62,7 +62,7 @@ internal class RealmSessionParamsStore @Inject constructor(private val mapper: S
return sessionParams
}

override fun save(sessionParams: SessionParams): Try<SessionParams> {
override fun save(sessionParams: SessionParams): Try<Unit> {
return Try {
val entity = mapper.map(sessionParams)
if (entity != null) {
@ -72,7 +72,6 @@ internal class RealmSessionParamsStore @Inject constructor(private val mapper: S
}
realm.close()
}
sessionParams
}
}