Skip to content

Commit 6a51c48

Browse files
fix(#2374): Add a validation in both BE and FE when there is no association between the legal type and client type (#2379)
* Revert "fix(#2374): Add a validation in both BE and FE when there is no assoc…" This reverts commit b10112d.
1 parent b10112d commit 6a51c48

2 files changed

Lines changed: 19 additions & 30 deletions

File tree

frontend/src/pages/bceidform/BusinessInformationWizardStep.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,6 @@ watch([autoCompleteResult], () => {
157157
formData.value.businessInformation.clientType = retrieveClientType(
158158
autoCompleteResult.value.legalType
159159
);
160-
161-
if (!formData.value.businessInformation.clientType) {
162-
toggleErrorMessages(null, null, null, null, true);
163-
return;
164-
};
165-
166160
showAutoCompleteInfo.value = false;
167161
168162
if (formData.value.businessInformation.clientType === 'RSP') {

frontend/src/pages/staffform/BcRegisteredClientInformationWizardStep.vue

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,6 @@ const errorBus = useEventBus<ValidationMessageType[]>(
6363
const formData = ref<FormDataDto>(props.data);
6464
const 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-
8466
watch(
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

Comments
 (0)