Don't require objects to be saved before calling toJSON()
This commit is contained in:
parent
ffb3823b4c
commit
39f7d0f333
|
@ -1175,10 +1175,6 @@ Zotero.DataObject.prototype.toResponseJSON = function (options) {
|
|||
|
||||
|
||||
Zotero.DataObject.prototype._preToJSON = function (options) {
|
||||
if (!this._id) {
|
||||
throw new Error(`${this._ObjectType} must be saved before running toJSON()`);
|
||||
}
|
||||
|
||||
var env = { options };
|
||||
env.mode = options.mode || 'new';
|
||||
if (env.mode == 'patch') {
|
||||
|
|
Loading…
Reference in New Issue
Block a user