2016-05-03 31 views
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'); 

回答

0

更新條目時,不需要傳遞內容類型標識作爲第一個參數。您應該僅將數據對象作爲第一個參數傳遞(這將在內容管理的下一個主要版本中進行更改)。