Could help me with this json?
json =
[
%{
roles: "none",
assignments: [
%{
assignee: %{
html_url: "https://test.com",
id: "111111",
summary: "Crypto ADA",
},
at: "2021-04-22T22:00:42-03:00"
},
%{
assignee: %{
html_url: "https://test.com",
id: "222222",
summary: "Crypto WIN",
},
at: "2021-04-22T22:00:42-03:00"
},
%{
assignee: %{
html_url: "https://test.com",
id: "333333",
summary: "Crypto Elongate",
},
at: "2021-04-22T22:00:42-03:00"
},
%{
assignee: %{
html_url: "https://test.com",
id: "44444",
summary: "Crypto Safemoon",
},
at: "2021-04-22T22:00:42-03:00"
},
%{
assignee: %{
html_url: "https://test.com",
id: "55555",
summary: "Crypto BTT",
},
at: "2021-04-22T22:00:42-03:00"
}
]
}
]
I’m using Enum.map, to do the deal.
Thus
Enum.map(json, &%{assignments: &1[:assignments]})
Currently I need the variable “assignments” to show all the names in a string.
Staying that way
&1[:assignments] = “Crypto ADA, Crypto WIN, Crypto Elongate, Crypto Safemoon, Crypto BTT”
My current difficulty and taking the summary field
How should I do this within Enum?