@@ -63,24 +63,6 @@ const errorBus = useEventBus<ValidationMessageType[]>(
6363const formData = ref <FormDataDto >(props .data );
6464const showUnsupportedLegalTypeError = ref <boolean >(false );
6565
66- const toggleErrorMessages = (
67- unsupportedLegalType : boolean | null = null ,
68- ) => {
69- showUnsupportedLegalTypeError .value = unsupportedLegalType ?? false ;
70-
71- if (unsupportedLegalType ) {
72- progressIndicatorBus .emit ({ kind: " disabled" , value: true });
73- exitBus .emit ({
74- unsupportedLegalType
75- });
76- } else {
77- progressIndicatorBus .emit ({ kind: " disabled" , value: false });
78- exitBus .emit ({
79- unsupportedLegalType: false
80- });
81- }
82- };
83-
8466watch (
8567 () => formData .value ,
8668 () => emit (" update:data" , formData .value )
@@ -164,17 +146,30 @@ watch([autoCompleteResult], () => {
164146 );
165147 formData .value .businessInformation .businessType = getEnumKeyByEnumValue (BusinessTypeEnum , BusinessTypeEnum .R );
166148
167- if (! formData .value .businessInformation .clientType ) {
168- toggleErrorMessages (true );
169- return ;
170- }
171-
172149 emit (" update:data" , formData .value );
173150
174151 if (formData .value .businessInformation .clientType === " RSP" ) {
175152 validation .birthdate = false ;
176153 }
177154
155+ const toggleErrorMessages = (
156+ unsupportedLegalType : boolean | null = null ,
157+ ) => {
158+ showUnsupportedLegalTypeError .value = unsupportedLegalType ?? false ;
159+
160+ if (unsupportedLegalType ) {
161+ progressIndicatorBus .emit ({ kind: " disabled" , value: true });
162+ exitBus .emit ({
163+ unsupportedLegalType
164+ });
165+ } else {
166+ progressIndicatorBus .emit ({ kind: " disabled" , value: false });
167+ exitBus .emit ({
168+ unsupportedLegalType: false
169+ });
170+ }
171+ };
172+
178173 // Also, we will load the backend data to fill all the other information as well
179174 const {
180175 error,
@@ -451,7 +446,7 @@ onMounted(() => {
451446 data-text =" Client information"
452447 v-shadow =" 2"
453448 id =" bcRegistrySearchNotification"
454- v-if =" !formData.businessInformation.clientType && !showUnsupportedLegalTypeError "
449+ v-if =" !formData.businessInformation.clientType"
455450 low-contrast =" true"
456451 open =" true"
457452 kind =" info"
0 commit comments