[Persistence] Handle overwrite/cancel

Handle Overwrite/Cancel more correctly when revision conflicts
are detected. WTD-1033.
This commit is contained in:
Victor Woeltjen
2015-03-20 14:39:47 -07:00
parent 513c06a81b
commit 1174f746f7
4 changed files with 59 additions and 19 deletions

View File

@ -155,11 +155,12 @@ define(
* of the success (true) or failure (false) of this
* operation
*/
updateObject: function (space, key, value) {
updateObject: function (space, key, value, options) {
var check = (options || {}).check;
function checkUpdate(response) {
return checkResponse(response, key);
}
return put(key, value, { version: revs[key] })
return put(key, value, check && { version: revs[key] })
.then(checkUpdate);
},
/**