From acf0950a261efda82521c4619f5937e7623a8176 Mon Sep 17 00:00:00 2001 From: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:43:57 +0530 Subject: [PATCH] MOSIP-23873 : Clearing off lower hierarchy fields while higher hierarchy value changed Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com> --- .../resources/center/create/create.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/admin-ui/src/app/features/resources/center/create/create.component.ts b/admin-ui/src/app/features/resources/center/create/create.component.ts index e098a518..3f8fbd74 100644 --- a/admin-ui/src/app/features/resources/center/create/create.component.ts +++ b/admin-ui/src/app/features/resources/center/create/create.component.ts @@ -385,10 +385,12 @@ export class CreateComponent { fieldName = this.locationFieldNameList[parseInt(index)+1]; locationCode = event.value; this.dynamicFieldValue[this.locationFieldNameList[parseInt(index)]] = event.value; - - /*for (let i = parseInt(index)+1; i < this.locationFieldNameList.length; i++) { - this.dynamicFieldValue[this.locationFieldNameList[parseInt(index)+1]] = []; - }*/ + } + if (index > 0) { + for (let i = index + 1; i < this.locationFieldNameList.length; i++) { + this.dynamicFieldValue[this.locationFieldNameList[i]] = ""; + this.dynamicDropDown[this.locationFieldNameList[i]] = []; + } } this.dataStorageService .getImmediateChildren(locationCode, this.primaryLang)