My GET request returns the data from my API as Objects inside an Object, and not an Array of Objects. This denies me from printing the data, since you need an iterable.
I don't really understand why this specific requests' output is different, since I have other GET requests that works just fine.
The component
this.apiService.getList(this.listId).subscribe((results: any) => {
this.recipes = results
console.log(results)
})
The service
getList(listId) {
return this.http.get(`https://secure-fortress-48055.herokuapp.com/api/v1/lists/${listId}`).pipe(
map((res: any) => res)
)
}
I'm thinking the mapping does nothing right now, since the response doesn't have any type set to it, so perhaps something is wrong with my API?
The data is fetched from my Laravel API, that uses a Resource
public function toArray($request)
{
return [
'id' => (string)$this->id,
'type' => 'Recipes',
'attributes' => [
'name' => $this->name,
'meal_id' => $this->meal_id,
'list_id' => $this->list_id,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]
];
}
Any idea what the issue is?

(results: any[]) =>and in the service(res: any[]) =>