REST API only returns image id and not img url

default discord avatar
2 weeks ago

I can only access all the nested data on my featuredImage object when logged into Payload CMS. If I make a request to /posts when not logged in, or from a different browser, featuredImage only shows an ID and not the full object. This means I can't access nested keys such as image url. I've attached screenshots

Also attached is a screenshot of my payloadconfig.ts file. I have cors configured to allow access from anywhere so I'm not sure what's causing this.

Can anyone help?


I worked it out. I forgot to set access to read

    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!


    Connect with the Payload Community on Discord



    Can't find what you're looking for?

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