From 0bb42b4dc3b060707d8ea0c3109480e0a6279697 Mon Sep 17 00:00:00 2001 From: Avanish Duggireddy Date: Tue, 26 Nov 2024 18:01:16 +0530 Subject: [PATCH] Removed hardcoded 'fullName' --- .../updatedemographic/updatedemographic.component.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 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 0d0f286e..3c5e9034 100644 --- a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts +++ b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts @@ -249,15 +249,20 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy { } - getUserInfo() { this.dataStorageService .getUserInfo('update-demographics') .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()