When I send an axios request like this:
async fetch() {
await this.$axios.get(`my_api_url`)
.then(response => {
this.data = response.data;
}).catch(() => { console.log('error') })
},
The response contains the following data:
{
"Apple": [
{
"id": 26,
"name": "Apple",
"date_in": "2020-07-01"
},
{
"id": 23,
"name": "Apple",
"date_in": "2020-06-01"
}
],
"Cherry": [
{
"id": 24,
"name": "Cherry",
"date_in": "2020-06-01"
}
],
"Banana": [
{
"id": 25,
"name": "Banana",
"date_in": "2020-06-01"
}
]
}
I would like to filter through this object and only keep the first entry of each category. Then, I want to display these selected objects in a new table.
Is there a way to accomplish this task?