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.

Serializing upload files in Rich Text Field

default discord avatar
Mateusz Woskowicz2 years ago
1

Hello!


I am using payload cms for my blog created in next.js. I have a problem downloading the image URL that I upload to AWS S3 in a Rich Text field.



The MongoDb query returns an object that contains the

id

of the image from the

media

table.



Currently, in the

serialize

component I created based on the docs on the frontend side sends a request to the api along with the id of the image, which returns me a

filename

from the media table.



Is there a simpler way to do this, to retrieve the

filename

immediately on the backend when querying to MongoDb?

  • discord user avatar
    dribbens
    2 years ago

    You can use Payload's local API to get your data out and have relationships and uploads populated by the desired depth you need for your frontend. It sounds like you are maybe querying with mongo/mongoose directly and missing out on a big advantage of working with Payload.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.