My Fetch request is returning an array of objects structured like this:
[
{"id":11,"name":"test1","day":"MON","level":2},
{"id":13,"name":"test2","day":"TUE","level":3},
{"id":14,"name":"test1","day":"WED","level":4},
{"id":15,"name":"test2","day":"FRI","level":5}
]
Within this array, there are four objects, two of which have the same name. To organize the result accordingly, it should look like this:
{
"test1" : [
{"id":11,"name":"test1","day":"MON","level":2},
{"id":14,"name":"test1","day":"WED","level":4}
],
"test2" :[
{"id":13,"name":"test2","day":"TUE","level":3},
{"id":15,"name":"test2","day":"FRI","level":5}
]
}