Need help updating a field in a CF entry. It is a dropdown field without a default value.
I tried to do that by getting the entry from the CF environment, setting the corresponding field and updating it like this:
client.getSpace(spaceId)
.then((space) => {space.getEnvironment(environment)
.then((environment) => {environment.getEntry('1234567890')
.then((entry) => {
entry.fields = {
state: {
'en-US': 'Arizona'
}
}
return entry.update()
})
})
})
By doing so, the state
value gets updated, but the other existing field values are deleted.
The Contentful documentation for content update states the same here: https://www.contentful.com/developers/docs/references/content-management-api/#/introduction/updating-content, but I cannot find a way to implement their suggestion.
How do I update the state
value without losing all the other fields?