Response addon

Options

Hi everyone !

I have got a little problem with the construction of an api answer.

I have got a product with a list of supplements.

I created a list-type addon to return my supplement information.
Everything works perfectly but in my response array I get the id's.

This is annoying in my frontend and prevents me from displaying the data correctly.

Do you have any solution idea for me?

Thanks 😀

Answers

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Hi @00liolio00 - you probably have your Addon set to return a list. Since your supplementsproduct field is already a list of items, you want your Addon to be set to return a single item. You're mapping each item in the list to the single object it references — not a list of items.