Hovhannes
07/21/2021, 12:56 PMinterface AuthApi : BaseApi {
@FormUrlEncoded
@PUT("{PartnerId}/api/Main/LoginClient")
suspend fun login(
@Field("email") email: String,
@Path("PartnerId") partnerId:String,
): LoginResponse
}
interface UserApi : BaseApi{
@GET("{PartnerId}/api/Main/LoginClient")
suspend fun getUser(@Path("PartnerId")partnerId:Int): LoginResponse
}
class UserRepository @Inject constructor(
private val api: UserApi
) : BaseRepository(api) {
suspend fun getUser() = safeApiCall { api.getUser(0) } <---getUser()'s argument must be EditText's value
}
iamthevoid
07/21/2021, 2:27 PMChrimaeon
07/21/2021, 6:54 PM