private fun dqmStringCheckForLastName() { val userParams = JsonObject() userParams.addProperty("userLastName", uiState.value.lastName.value) viewModelScope.launch(Dispatchers.IO) { when(val result = getCountryDataUseCase.checkDqmStringChecker( body = userParams )) { is RemoteResponse.Success -> { result.value.results.forEach { if(it.fieldName == "CP_LASTNAME" && it.severity == "E") { when(val value = validateUserInformationScreen(errorTypeForLast = ErrorType.Error)) { null -> { } else -> { displayUserInformationErrors(value) } } } else if(it.fieldName == "CP_LASTNAME" && it.severity == "W") { when(val value = validateUserInformationScreen(errorTypeForLast = ErrorType.Warning)) { null -> { } else -> { displayUserInformationErrors(value) } } } else if (it.fieldName == "CP_LASTNAME" && it.valid) { ReCaptchaService.validateWithEnterpriseReCaptchaService( null, ReCaptchaEventEnum.CREATE_ACCOUNT ) } } } is RemoteResponse.Failure -> { } } } }
This function runs the dqm checker API for the last name