Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Populate collection after REST api is called

default discord avatar
kresimirgalic12 months ago
2

Hey guys, i am calling /posts for example, and i have author and category collection which needs to be populated if i pass depth=1 in params, but it doesnt. Does anyone knows whats the problem?

  • discord user avatar
    dribbens
    12 months ago

    That's likely because of access control on the collections preventing them from populating.



    Test again after changing access.read to

    () => true

    as a test.

  • default discord avatar
    kresimirgalic12 months ago

    yes, that was the problem



    thanks

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.