I have a query that returns a SKU with an array of Locations like this:
[{
"Locations": ["TP-401176509", [{
"WarehouseCode": "01",
"LocationCode": "A-04B01-B",
"Quantity": 1,
"Reserve": false
}, {
"WarehouseCode": "01",
"LocationCode": "A-04B02-A",
"Quantity": 1,
"Reserve": false
}, {
"WarehouseCode": "01",
"LocationCode": "A-04B13-A",
"Quantity": 1,
"Reserve": false
}]]
}
OP is expecting to see this on output side:
[{
"Sku": "TP-401176509",
"WarehouseCode": "01",
"LocationCode": "A-04B01-B",
"Quantity": 1,
"Reserve": false
}, {
"Sku": "TP-401176509",
"WarehouseCode": "01",
"LocationCode": "A-04B02-A",
"Quantity": 1,
"Reserve": false
}, {
"Sku": "TP-401176509",
"WarehouseCode": "01",
"LocationCode": "A-04B13-A",
"Quantity": 1,
"Reserve": false
}]
Essentially i want to map Locations[0] as a "Sku" object to fill the array in Locations[1]