Skip to content

Commit c16b288

Browse files
committed
ecer-5200 fixing issue where we were clearing out ITE + SNE upgrade paths. Causing draft applications to be created without a certificate type
1 parent ece1d6a commit c16b288

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/ApplicationRequirements.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,15 @@ export default defineComponent({
193193
}
194194
this.router.push({ name: "declaration" });
195195
} else {
196-
//this corrects edge case where user clicks requirements and does not select a new path. We need to remove ITE + SNE or it will persist.
197-
const currentTypes =
198-
this.applicationStore.draftApplication.certificationTypes?.filter((certification) => certification !== "Ite" && certification !== "Sne") || [];
196+
let currentTypes = this.applicationStore.draftApplication.certificationTypes || [];
197+
198+
// Filter out "Ite" and "Sne" unless currentTypes *only* contains "Ite" or "Sne".
199+
// This corrects edge case where user clicks requirements and does not select a new path. We need to remove ITE + SNE or it will persist.
200+
currentTypes =
201+
currentTypes.length === 1 && (currentTypes.includes("Ite") || currentTypes.includes("Sne"))
202+
? currentTypes
203+
: currentTypes.filter((certification) => certification !== "Ite" && certification !== "Sne");
204+
199205
const updatedTypes = [...currentTypes, ...this.specializationSelection];
200206
201207
// Remove duplicates if necessary

0 commit comments

Comments
 (0)