Fix symbol in Student
This commit is contained in:
parent
79ad6d7eb3
commit
95bcb8bf46
2 changed files with 4 additions and 4 deletions
|
@ -187,7 +187,7 @@ class Sdk {
|
|||
|
||||
fun getStudents(): Single<List<Student>> {
|
||||
return when (mode) {
|
||||
Mode.API -> mobile.getApiStudents(token, pin, symbol).map { it.mapStudents() }
|
||||
Mode.API -> mobile.getApiStudents(token, pin, symbol).map { it.mapStudents(symbol) }
|
||||
Mode.SCRAPPER -> {
|
||||
scrapper.run {
|
||||
ssl = this@Sdk.ssl
|
||||
|
@ -215,7 +215,7 @@ class Sdk {
|
|||
scrapper.getToken().compose(ScrapperExceptionTransformer()).flatMap {
|
||||
mobile.getApiStudents(it.token, it.pin, it.symbol)
|
||||
}.map { apiStudents ->
|
||||
apiStudents.mapStudents().map { apiStudent ->
|
||||
apiStudents.mapStudents(symbol).map { apiStudent ->
|
||||
apiStudent.copy(
|
||||
loginMode = Mode.HYBRID,
|
||||
scrapperHost = scrapperHost,
|
||||
|
|
|
@ -5,11 +5,11 @@ import io.github.wulkanowy.sdk.pojo.Student
|
|||
import io.github.wulkanowy.api.register.Student as ScrapperStudent
|
||||
import io.github.wulkanowy.sdk.mobile.register.Student as ApiStudent
|
||||
|
||||
fun List<ApiStudent>.mapStudents(): List<Student> {
|
||||
fun List<ApiStudent>.mapStudents(symbol: String): List<Student> {
|
||||
return map {
|
||||
Student(
|
||||
email = it.userLogin,
|
||||
symbol = it.reportingUnitSymbol,
|
||||
symbol = symbol,
|
||||
studentId = it.id,
|
||||
userLoginId = it.userLoginId,
|
||||
classId = it.classId,
|
||||
|
|
Loading…
Reference in a new issue