From 00e53fdef9d79f1ba30ebcc4c656fb56a90055a5 Mon Sep 17 00:00:00 2001 From: "guilhem.carron" <gcarron@grandlyon.com> Date: Wed, 26 Jan 2022 16:17:09 +0100 Subject: [PATCH] fix(profileType): Remove data from previous profileType when the question is not asked again --- src/services/profileType.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/profileType.service.ts b/src/services/profileType.service.ts index aaa2dc314..5ce0179da 100644 --- a/src/services/profileType.service.ts +++ b/src/services/profileType.service.ts @@ -544,6 +544,9 @@ export default class ProfileTypeService { profileType.hotWaterEquipment = HotWaterEquipment.OTHER } } + if (profileType.constructionYear === ConstructionYear.AFTER_1998) { + profileType.individualInsulationWork = [IndividualInsulationWork.NONE] + } // Remove potential metadata from already existing profileType in order // to create a new entry. Otherwise will update existing one. if (profileType._id) { -- GitLab