Shadman
ktor
@POST("user/register") suspend fun singUp(@Body signUpInputModel: SignUpInputModel): Response<SignUpModel>
errorBody
readAsText
bodyAsText
fun singUp(userName: String, mobile: String, password: String) = viewModelScope.launch { authRepo.singUp(userName, mobile, password).onSuccess { response -> if (response.isSuccessful) _signupState.value = Loadable.Success(response.body()!!) else { response.errorBody() } }.onFailure { _signupState.value = Loadable.Error(it) } }
A modern programming language that makes developers happier.