Closed totaltrash closed 4 years ago
Looks like I need to normalize the collection first? Which makes sense, as I can then choose the serializer group to normalize to
/**
* @Route("/item/", name="item_list")
*/
public function itemList(InertiaInterface $inertia, ItemRepository $repo, NormalizerInterface $normalizer)
{
return $inertia->render('ItemList', [
'items' => $normalizer->normalize($repo->findAll(), null, ['groups' => 'some_group']),
]);
}
Hi @totaltrash, sorry for getting back to you so late. I understand you solved this issue yourself?
Yes, thanks @rompetomp
I think I'm missing something regarding sending a collection of entities to be rendered by Inertia. I have the following action:
Which works great when doing a hard browser refresh:
But returns empty objects in the xhr response:
What am I missing?!