I am currently developing an API that retrieves data from an external source. After processing the business logic, I end up with the following response:
{
data: [
{
BTC: {
USD: 46389.84,
RUB: 3406131.15,
EUR: 39472.76,
},
},
{
ETH: {
USD: 3215.65,
RUB: 235786.69,
EUR: 2741.52,
},
},
],
}
My goal is to eliminate this nesting and simplify the result to:
{
data: {
BTC: {
USD: 46389.84,
RUB: 3406131.15,
EUR: 39472.76,
},
ETH: {
USD: 3215.65,
RUB: 235786.69,
EUR: 2741.52,
},
},
}