Include information about saved snapshots in /saveSnapshot
This commit is contained in:
parent
5928147f26
commit
02ba9ca7f0
1 changed files with 8 additions and 2 deletions
|
@ -1128,7 +1128,7 @@ Zotero.Server.Connector.SaveSnapshot.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let item = await this.saveSnapshot(targetID, requestData);
|
var item = await this.saveSnapshot(targetID, requestData);
|
||||||
await session.addItem(item);
|
await session.addItem(item);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
@ -1136,9 +1136,15 @@ Zotero.Server.Connector.SaveSnapshot.prototype = {
|
||||||
return 500;
|
return 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let attachments = [];
|
||||||
|
let hasAttachments = item.getAttachments().length;
|
||||||
|
if (hasAttachments) {
|
||||||
|
attachments = [{mimeType: "text/html", title: data.title, url: data.url}];
|
||||||
|
}
|
||||||
|
|
||||||
return [201,
|
return [201,
|
||||||
"application/json",
|
"application/json",
|
||||||
JSON.stringify({ saveSingleFile: !data.skipSnapshot && !data.pdf })];
|
JSON.stringify({ saveSingleFile: !data.skipSnapshot && !data.pdf && data.singleFile, attachments })];
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue