Contentful logo

Contentful Community

Publish always returns 409 on update with Contenful Management SDK

Hi,

I’'ve been trying to update fields and publish again.

I follow these steps;

  1. I get entry [env.getEntries]
  2. make updates on fields
  3. call [await entry.update()]
  4. call [await entry.publish()]

I read the api documentation, It says I need to set a header with version. But I assume and see on the log that sdk does that itself.

So what thing am I missing here?

I could get a comment from support team fastly.

They mentioned I need to get entry before publishing. As on the state I still had previous version and that needs to be fetched again.