Apologies but I am learning array manipulation, tried a few things as I have done similar before but just cant figure this out. I am building a react application and have got my data back from the UI but need to reformat for the API. My payload looks like this...
0: {from: "U20", Id: "1922", to: "U21"}
1: {from: "U20", Id: "9338", to: "U21"}
2: {from: "U20", Id: "1927", to: "U21"}
3: {from: "U20", Id: "1730", to: "U21"}
I need to create a group for all the ids and post back the from and to fields.
{
"from": "U20",
"Ids": ["1922","9338","1927","1730"],
"to:": "U21"
}
I have lodash as a helper library.
fromandtovalues?