File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
feature/auth/src/commonMain/kotlin/org/mifos/mobile/feature/auth/registration Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -187,16 +187,15 @@ class RegistrationViewModel(
187187 */
188188 @Suppress(" ReturnCount" )
189189 private fun validateName (name : String , nameType : String ): ValidationResult ? {
190- if (name.isEmpty()) {
190+ if (name.isEmpty() && nameType != " middle " ) {
191191 return when (nameType) {
192192 " first" -> ValidationResult .Error (Res .string.feature_signup_error_first_name_empty)
193- " middle" -> ValidationResult .Error (Res .string.feature_signup_error_middle_name_empty)
194193 " last" -> ValidationResult .Error (Res .string.feature_signup_error_last_name_empty)
195194 else -> ValidationResult .Error (Res .string.feature_signup_error_invalid_name)
196195 }
197196 }
198197
199- if (! ValidationHelper .isValidName(name)) {
198+ if (name.isNotEmpty() && ! ValidationHelper .isValidName(name)) {
200199 return ValidationResult .Error (Res .string.feature_signup_error_invalid_name)
201200 }
202201
@@ -625,10 +624,11 @@ data class SignUpState(
625624 /* *
626625 * Whether the submit button should be enabled based on required fields.
627626 */
627+ // TODO Uncomment if middle name field is mandatory
628628 val isSubmitButtonEnabled: Boolean
629629 get() = customerAccount.isNotBlank() &&
630630 firstName.isNotBlank() &&
631- middleName.isNotBlank() &&
631+ // middleName.isNotBlank() &&
632632 lastName.isNotBlank() &&
633633 email.isNotBlank() &&
634634 password.isNotBlank() &&
You can’t perform that action at this time.
0 commit comments