I need to flatten a nested object.
I've got my missingData like this:
{
a:2,
b: {
c:3
}
}
And I need ...
{
a:2,
b:3
}
but my model is like this:
request {
a: string,
b: user,
c: string
}
user {
id: string
}
I tried this:
let request = missingData;
request.b = request.b.id;
but Type 'string' has no properties in common with type 'user'.