Add version
option to toResponseJSON()
This commit is contained in:
parent
3390f2405b
commit
d67c654245
2 changed files with 8 additions and 4 deletions
|
@ -1252,12 +1252,16 @@ Zotero.DataObject.prototype._finalizeErase = Zotero.Promise.coroutine(function*
|
|||
Zotero.DataObject.prototype.toResponseJSON = function (options) {
|
||||
// TODO: library block?
|
||||
|
||||
return {
|
||||
var json = {
|
||||
key: this.key,
|
||||
version: this.version,
|
||||
meta: {},
|
||||
data: this.toJSON(options)
|
||||
};
|
||||
if (options.version) {
|
||||
json.version = json.data.version = options.version;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -782,9 +782,9 @@ describe("Zotero.Sync.Data.Engine", function () {
|
|||
},
|
||||
JSON.stringify({
|
||||
successful: {
|
||||
"0": item2.toResponseJSON(),
|
||||
"1": item1.toResponseJSON(),
|
||||
"2": item3.toResponseJSON()
|
||||
"0": item2.toResponseJSON({ version: lastLibraryVersion }),
|
||||
"1": item1.toResponseJSON({ version: lastLibraryVersion }),
|
||||
"2": item3.toResponseJSON({ version: lastLibraryVersion })
|
||||
},
|
||||
unchanged: {},
|
||||
failed: {}
|
||||
|
|
Loading…
Reference in a new issue