package com.abbidot.tracker.deprecated.ui.activity.vm

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.abbidot.tracker.base.BaseActivity
import com.abbidot.tracker.retrofit2.NetworkApi
import kotlinx.coroutines.launch

/**
 *Created  by .yzq on 2022/3/24/024.
 * @link
 * @description:
 */
class ChangePasswordViewModel : ViewModel() {

    val mResetPasswordLiveData = MutableLiveData<Result<String>>()

    /**
     * 重置密码
     */
    fun resetPassword(activity: BaseActivity<*>, email: String, password: String) {
        activity.showLoading(true)
        viewModelScope.launch {
            val result = NetworkApi.resetPassword(email, password)
            mResetPasswordLiveData.value = result
        }
    }
}