Update a localized modular content field

Example return value for a localized modular content

{ de:
[ β€˜10399988’,
β€˜10399998’ ],
[ β€˜10380315’,
β€˜10380325’ ]

How can I update the modular content for de ?

I have tried client.items.update('10399988', { /* update obj*/ }) but i am getting a 404 because 10399988 is not a valid items id. Could someone point me to any documentation for my use case ?

On this update, I noticed that changes were made to the Modular Content field and the new create example was demonstrated. Is there an example for update ?

hello @niko,

have you seen this documentation: https://www.datocms.com/docs/content-management-api/resources/item/create#add-a-modular-content

You can use the update the same way as the create, but remember to update the entire record with its submodules, not a single block, OK? That is not possible anymore.

Let me know if that makes sense to you.


Thank you!

The β€œupdate” would mean that I need to build all new modular block entries and pass the new IDs to the modular content field. I was looking for a method like
modular.update(ID, { }) for a modular entry

hey @niko, unfortunately you cannot update the single block, but you can just pass the IDs of the blocks that you are not going to touch when you update the record. Does that make sense?