I have a JSON object coming from my server with the following structure:
[
{
"id":1,
"tag":"Cooking",
"weight":null,
"deleted_at":null,
"created_at":null,
"updated_at":null,
"listings":[
{
"id":5,
"name":"Learn how to make the perfect hotpot with",
"slug":"learn-how-to-make-the-perfect-hotpot-with",
"description":"We live in a unique and wonderful time where electric guitars are things that we can rock on. ...awesome rockin’.",
"booking_details":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore... "25.00",
"active":1,
"moderated":1,
"user_id":3,
"category_id":null,
"deleted_at":null,
"created_at":"2020-06-18T13:41:05.000000Z",
"updated_at":"2020-06-24T22:50:48.000000Z",
"tagsList":"Cooking",
...
}
]
},
...
]
The objective is to filter out listing objects with a price of "0.00". The current attempt is not yielding desired results, possibly due to navigating through multiple nested objects. Here's the current logic:
filteredListings() {
return this.tags.filter((listings) => {
return listings.filter((l) => {
console.log(l.cost);
})
})
}
Any assistance or guidance on refining the filtering process would be greatly appreciated.