[Persistence] Rewrite failure handling

Rewrite the overwrite behavior (for Overwrite/Cancel of rejected
persisted attempts) to utilize simpler API. WTD-1033.
This commit is contained in:
Victor Woeltjen
2015-03-20 15:28:15 -07:00
parent 66fd899650
commit d8e1f69b37
3 changed files with 44 additions and 31 deletions

View File

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