Like what we’re doing? Star us on GitHub!

Local API: How to provide data for all locales?

fewbar
last month
2

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: ...},
    }
});
  • dribbens
    Payload Team
    4 weeks 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.

  • fewbar
    4 weeks ago

    thanks! 🙂

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More