remove nullable from PollRepository return types

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-07-19 12:30:05 +02:00 committed by Andy Scherzinger (Rebase PR Action)
parent 87fdd7017d
commit 3267fc2f47
2 changed files with 6 additions and 6 deletions

View File

@ -33,11 +33,11 @@ interface PollRepository {
options: List<String>,
resultMode: Int,
maxVotes: Int
): Observable<Poll>?
): Observable<Poll>
fun getPoll(roomToken: String, pollId: String): Observable<Poll>?
fun getPoll(roomToken: String, pollId: String): Observable<Poll>
fun vote(roomToken: String, pollId: String, options: List<Int>): Observable<Poll>?
fun vote(roomToken: String, pollId: String, options: List<Int>): Observable<Poll>
fun closePoll(roomToken: String, pollId: String): Observable<Poll>?
fun closePoll(roomToken: String, pollId: String): Observable<Poll>
}

View File

@ -45,7 +45,7 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
resultMode: Int,
maxVotes:
Int
): Observable<Poll>? {
): Observable<Poll> {
return ncApi.createPoll(
credentials,
ApiUtils.getUrlForPoll(
@ -71,7 +71,7 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
).map { mapToPoll(it.ocs?.data!!) }
}
override fun vote(roomToken: String, pollId: String, options: List<Int>): Observable<Poll>? {
override fun vote(roomToken: String, pollId: String, options: List<Int>): Observable<Poll> {
return ncApi.votePoll(
credentials,