The API data looks like this:
{
"00041335": {
"productId": "8e786e6b",
"variantId": "0b43df16"
},
"00032183": {
"productId": "9e780e6d",
"variantId": "0b48df17"
}
}
I want to make it like this:
[
{
"skuId": "00041335",
"productId": "8e786e6b",
"variantId": "0b43df16"
},
{
"skuId": "00032183",
"productId": "9e780e6d",
"variantId": "0b48df17"
}
]
How to restructure the object? Is reduce
appropriate or is there a better way?