diff --git a/demo/bundle.js b/demo/bundle.js index 1be155a..6b909e4 100644 --- a/demo/bundle.js +++ b/demo/bundle.js @@ -213,13 +213,15 @@ var SkygearChatContainer = exports.SkygearChatContainer = function () { }, { key: 'updateConversation', value: function updateConversation(conversation, title, meta) { + var newConversation = new Conversation(); + newConversation._id = conversation._id; if (title) { - conversation.title = title; + newConversation.title = title; } if (meta) { - conversation.meta = meta; + newConversation.meta = meta; } - return _skygear2.default.publicDB.save(conversation); + return _skygear2.default.publicDB.save(newConversation); } /** @@ -527,7 +529,7 @@ var SkygearChatContainer = exports.SkygearChatContainer = function () { * @param {number} [limit=50] - limit the result set, if it is set to too large, may * result in timeout. * @param {Date} beforeTime - specific from which time - * @param {string} order - order of the message, '_edited_at' or '_created_at' + * @param {string} order - order of the message, 'edited_at' or '_created_at' * @return {Promise<[]Message>} - array of Message records */ diff --git a/lib/container.js b/lib/container.js index 4041de5..8197a8d 100644 --- a/lib/container.js +++ b/lib/container.js @@ -155,13 +155,15 @@ export class SkygearChatContainer { * @return {Promise} - A promise to save result */ updateConversation(conversation, title, meta) { + let newConversation = new Conversation(); + newConversation._id = conversation._id; if (title) { - conversation.title = title; + newConversation.title = title; } if (meta) { - conversation.meta = meta; + newConversation.meta = meta; } - return skygear.publicDB.save(conversation); + return skygear.publicDB.save(newConversation); } /**