Local API: How to provide data for all locales?

default discord avatar
phewbar
7 months ago
4

How can I provide data for all locales when using

payload.create

?

title

is normally a string.. Do I have to make two API calls (one create and one update)?


Or is something like this possible:


payload.create({
    collection: 'pages',
    data: {
        title: {en: ..., es: ...},
    }
});
  • discord user avatar
    dribbens
    Payload Team
    7 months ago

    This isn't currenlty possible with the existing APIs.


    For now you have to create in one locale and then perform a separate update for each locale.


    At some point this will need to be built into Payload.

  • default discord avatar
    phewbar
    7 months ago

    thanks! 🙂

  • default discord avatar
    linobino1
    2 weeks ago

    I want this too!

  • discord user avatar
    dribbens
    Payload Team
    2 weeks ago

    Noted!

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.