image upload static url

default discord avatar
Raoul
2 months ago
6

Hi, any idea why my node.value.url comes out as "api/collection/media/name" and not with id.

  • default discord avatar
    notchr
    2 months ago

    @Raoul Good morning! Could you please post an example of the code in question?

  • default discord avatar
    Raoul
    2 months ago

    Sure thingy, just a sec



    so im stuck with the name instead of id



    And good morning 🙂

    image.png
    image.png
  • default discord avatar
    notchr
    2 months ago

    Hmm



    Does the image display?



    Also, where do you get node.value.url from

  • default discord avatar
    Raoul
    2 months ago

    nopw



    but if i correctly replace the name with id it the api address works fine



    {"id":"64ad3547943f936396cedacf","alt":"ux","filename":"hash.png","mimeType":"image/png","filesize":5036,"width":56,"height":56,"createdAt":"2023-07-11T10:56:07.152Z","updatedAt":"2023-07-11T10:56:07.152Z","url":"cms-api/media/hash.png"}

    return value from my media collection

  • default discord avatar
    notchr
    2 months ago

    can i checkout your payload.config.js



    seems like a misconfigured server url

  • default discord avatar
    Raoul
    2 months ago

    ahh



    routes: {


    api: "/cms-api",


    admin: "/cms-admin",


    },



    changed my staticURL: "cms-admin and found my content

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

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

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