0
我試圖使用content-management節點模塊更新Contentful中的現有條目。 這是我使用的代碼,但是我無法更新條目,也沒有發現任何錯誤。如何使用內容管理節點模塊更新Contentful條目
var client = contentful.createClient({
// A valid access token for your user (see above on how to create a valid access token)
accessToken: 'accessToken value',
// Enable or disable SSL. Enabled by default.
secure: true
});
var log = console.log.bind(console);
client.getSpace('spaceId value').then(function(space) {
//return space.getEntries();
space.updateEntry("Sites", {
sys: {id: 'entryId value', version:15},
fields: {
siteName: {'en-US': 'value'}
}
});
}).then(log, log);
res.send('hello');