private suspend fun getBusinessRoles() { when(val roles = getBusinessRoleUseCase.getBusinessRole( fullUrl = NetworkingService.instance.getOnboardingAPIURL("onboarding/business-roles"), headers = NetworkingService.instance.anAccessTokenHeadersForSignUp as HashMap<String, String> /* = java.util.HashMap<kotlin.String, kotlin.String> */, )) { is RemoteResponse.Success -> { _uiState.value = uiState.value.copy( signInProcessing = false, businessRole = roles.value.results ) } is RemoteResponse.Failure -> { } } } private fun createAccount() { NetworkingService.instance.anNewStackAPIsGoogleRecaptchaPost( "onboarding/accounts", proceedToAccountCreationApiCall(), isContactAdmin = false, object : JSONObjectRequestListener { override fun onResponse(response: JSONObject) { _uiState.value = uiState.value.copy( signInProcessing = false ) viewModelScope.launch(Dispatchers.Main) { navigationEvent.emit(RegistrationNavigationEvent.OpenSignUpConfirmationScreen) } } override fun onError(ANError: ANError) { } }, false, false, ) }
This functions gets the business role list fro the API call