I wanted to insert each keys from object to another object , I wanna add it to the payload.
I tried this one but it was insert as a whole object. What I want is to get the sample result below . Any ideas would be much appreciated.
const payload: requestPayload| any = {
accountId: 1,
keystoInsert
};
#object that I wanna insert
keystoInsert = {
"marketName": "Chicago",
"roleUserFirstName": null,
"roleUserLastName": null,
"roleUserEmailAddress": null
}
#code snippet
const payload: requestPayload | any = {
accountId: 1,
};
#expected output
{
"accountId": 1,
"marketName": "Chicago",
"roleUserFirstName": null,
"roleUserLastName": null,
"roleUserEmailAddress": null
}