From 6553eda24b9b24ae2c5d473c8abfa2dbd890b4c6 Mon Sep 17 00:00:00 2001 From: MadhuMosip Date: Thu, 8 Aug 2024 15:37:25 +0530 Subject: [PATCH] MOSIP-35115 removed fullName hardcoded value to get preferred languages Signed-off-by: MadhuMosip --- .../updatedemographic/updatedemographic.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts index 995ba931..352f26ea 100644 --- a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts +++ b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts @@ -263,8 +263,14 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy { .subscribe((response) => { if (response["response"]) { this.userInfo = response["response"]; - this.userInfo['fullName'].forEach(item=>{ - this.getUserPerfLang.indexOf(item.language) === -1 ? this.getUserPerfLang.push(item.language) : '' + Object.keys(this.userInfo).forEach(item =>{ + if(typeof this.userInfo[item] !== 'string' && this.userInfo[item].length){ + if(this.getUserPerfLang.length){ + this.userInfo[item].forEach(eachItem=>{ + this.getUserPerfLang.indexOf(eachItem.language) === -1 ? this.getUserPerfLang.push(eachItem.language) : '' + }) + } + } }) UpdatedemographicComponent.actualData = response["response"]; this.buildData()