Fix params order

This commit is contained in:
Mikołaj Pich 2019-04-14 23:11:23 +02:00
parent 11008b8c73
commit c26b6cabd3
No known key found for this signature in database
GPG key ID: F62B26E36D4C4BAA
2 changed files with 2 additions and 2 deletions

View file

@ -59,7 +59,7 @@ class LoginHelper(
}
}
fun sendCertificate(certificate: CertificateResponse, url: String = certificate.action, email: String = ""): Single<SendCertificateResponse> {
fun sendCertificate(certificate: CertificateResponse, email: String = "", url: String = certificate.action): Single<SendCertificateResponse> {
cookies.cookieStore.removeAll()
return api.sendCertificate(url + if (email.isNotBlank()) "?rebuild=$email" else "", mapOf(
"wa" to certificate.wa,

View file

@ -34,7 +34,7 @@ class RegisterRepository(
fun getStudents(): Single<List<Student>> {
return getSymbols().flatMapObservable { Observable.fromIterable(it) }.flatMap { (symbol, certificate) ->
loginHelper.sendCertificate(certificate, certificate.action.replace(startSymbol.getNormalizedSymbol(), symbol))
loginHelper.sendCertificate(certificate, "", certificate.action.replace(startSymbol.getNormalizedSymbol(), symbol))
.onErrorResumeNext { t ->
if (t is AccountPermissionException) Single.just(SendCertificateResponse())
else Single.error(t)