Update only localized content of a record

Hello folks,
I am using the Dato JS client to create / update content for one my models that also has localized fields. However when I try to update the fields for a particular locale via the js client, all the other locales seem to get deleted.

For example: I already have the values for populated for en locale and while trying to update the values for es.

      datoClient.items.update(RECORD_ID, {
        title: {
          es: 'sometitle',
        },
        slug: {
          es: 'someslug',
        },
      });

Executing the above snippet, the values for es seems to be populated, but the existing values that en had, have all been removed.

Is there some way that I can just update the localized value without providing the entire object for other locales as well?

hello @swaroop.sethumadhavan, unfortunately you need to pass all the locales, as otherwise we don’t have a way to tell if you are removing a locale, right?

I see. That makes sense. I am passing values for all the locales and the update happens nicely now.
Thank you! :slight_smile:

1 Like