I am getting data from an Object type from my database but the nested data inside the Object type is undeclared since its just a normal Object interface. So the task is that I must get the data from within this Object and put all of the data on the same level for instance:
contactDetails: Object; // this is how it is set in my class
//this is how i get it from the db
{
"contactDetails": {
"firstName": "John",
"lastName": "Doe",
"email": "jd@email.com",
"phoneNumber": "0123456789"
},
"clientAccountNumber": "test1234"
}
and how it should look is like as following:
"newObject":{
"firstName": "John",
"lastName": "Doe",
"email": "jd@email.com",
"phoneNumber": "0123456789"
"clientAccountNumber": "test1234"
}
The part I am struggling with is I don't know how to get that specific data from contactDetails
for example contactDetails.firstName
won't work and valueOf()
also gives me issues. Any suggestions or help is appreciated