parent
09209c150f
commit
c7b238f975
|
@ -9,6 +9,7 @@ import kr.co.vividnext.sodalive.base.BaseViewModel
|
|||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.mypage.auth.AuthRepository
|
||||
import kr.co.vividnext.sodalive.mypage.auth.AuthVerifyRequest
|
||||
import kr.co.vividnext.sodalive.settings.ContentType
|
||||
import kr.co.vividnext.sodalive.user.UserRepository
|
||||
|
||||
class MyPageViewModel(
|
||||
|
@ -71,7 +72,13 @@ class MyPageViewModel(
|
|||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
{
|
||||
if (it.success) {
|
||||
if (it.success && it.data != null) {
|
||||
SharedPreferenceManager.contentPreference = if (it.data.gender == 0) {
|
||||
ContentType.FEMALE.ordinal
|
||||
} else {
|
||||
ContentType.MALE.ordinal
|
||||
}
|
||||
|
||||
onSuccess()
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
|
|
|
@ -11,5 +11,5 @@ interface AuthApi {
|
|||
fun verify(
|
||||
@Body request: AuthVerifyRequest,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<Any>>
|
||||
): Single<ApiResponse<AuthResponse>>
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
package kr.co.vividnext.sodalive.mypage.auth
|
||||
|
||||
data class AuthResponse(val gender: Int)
|
Loading…
Reference in New Issue