How to display specific number of items for Joining table (latest products of list of brands)

Hello!

I want to display list of brands that have latest products in shop.

I have endpoint where table Brand joins with Products and as a result I have

[
brand1  {product  [1, 2 3 ...]}
brand2  {product  [1, 2 3 ...]}
]
with sorting brands by 'last added product' and products inside should be also sorted by last added product for each brand.

How to limit number of products for each brand like 10 latest products?
I haven't found where I can do it in setting up my endopoint.
 
My result now works incorrect:

it returns same brand with chunks of products untill all products counted and then display next product same way[Screenshot 2022-07-09 at 07.40.38.png]
Other
4 replies