I have JSON format like this I not sure how do I create new array of objects from an different array of object
[
{
"description":"microsoftLocation",
"icon":"Marker",
"data_id":"123",
"reference":"_1_microsoftOffice",
"id":1,
"text":"microsoftOffice"
},
{
"description":"facebookOffice",
"icon":"Marker",
"data_id":"456",
"reference":"_2_facebookOffice",
"id":2,
"text":"_2_microsoftOffice"
},
]
I want the output to look something like this and not sure how to get the dynamic url as well
[
{
"url":"http://localhost:3000/layer?text=microsoftLocation&data_id=123",
"text":"microsoftLocation",
"active":true,
"icon":Marker
},
{
"url":"http://localhost:3000/layer?text=facebookOffice&data_id=123",
"text":"facebookOffice",
"active":true,
"icon":Marker
},
]