Skip to content

Commit

Permalink
TF-3178 Add verify name only contain spaces for identity name
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 authored and hoangdat committed Nov 3, 2024
1 parent bb3c28b commit c8bc63e
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import 'package:tmail_ui_user/features/identity_creator/presentation/model/ident
import 'package:tmail_ui_user/features/identity_creator/presentation/utils/identity_creator_constants.dart';
import 'package:tmail_ui_user/features/mailbox_creator/domain/model/verification/email_address_validator.dart';
import 'package:tmail_ui_user/features/mailbox_creator/domain/model/verification/empty_name_validator.dart';
import 'package:tmail_ui_user/features/mailbox_creator/domain/model/verification/name_with_space_only_validator.dart';
import 'package:tmail_ui_user/features/mailbox_creator/domain/state/verify_name_view_state.dart';
import 'package:tmail_ui_user/features/mailbox_creator/domain/usecases/verify_name_interactor.dart';
import 'package:tmail_ui_user/features/mailbox_creator/presentation/extensions/validator_failure_extension.dart';
Expand Down Expand Up @@ -126,7 +127,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
}

void updateNameIdentity(BuildContext context, String? value) {
_nameIdentity = value?.trim();
_nameIdentity = value;
errorNameIdentity.value = _getErrorInputNameString(context);
}

Expand Down Expand Up @@ -554,7 +555,10 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
String? _getErrorInputNameString(BuildContext context) {
return _verifyNameInteractor.execute(
_nameIdentity,
[EmptyNameValidator()]
[
EmptyNameValidator(),
NameWithSpaceOnlyValidator(),
],
).fold(
(failure) {
if (failure is VerifyNameFailure) {
Expand All @@ -573,8 +577,11 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
return null;
}
return _verifyNameInteractor.execute(
emailAddress,
[EmailAddressValidator()]
emailAddress,
[
EmailAddressValidator(),
NameWithSpaceOnlyValidator(),
],
).fold(
(failure) {
if (failure is VerifyNameFailure) {
Expand Down

0 comments on commit c8bc63e

Please sign in to comment.