mirror of
https://github.com/zotero/zotero.git
synced 2026-10-07 02:58:09 +00:00
Include information about saved snapshots in /saveSnapshot
This commit is contained in:
parent
266060dc48
commit
48c7c60bf1
1 changed files with 8 additions and 2 deletions
|
|
@ -1135,7 +1135,7 @@ Zotero.Server.Connector.SaveSnapshot.prototype = {
|
|||
}
|
||||
|
||||
try {
|
||||
let item = await this.saveSnapshot(targetID, requestData);
|
||||
var item = await this.saveSnapshot(targetID, requestData);
|
||||
await session.addItem(item);
|
||||
}
|
||||
catch (e) {
|
||||
|
|
@ -1143,9 +1143,15 @@ Zotero.Server.Connector.SaveSnapshot.prototype = {
|
|||
return 500;
|
||||
}
|
||||
|
||||
let attachments = [];
|
||||
let hasAttachments = !item.isAttachment() && item.getAttachments().length;
|
||||
if (hasAttachments) {
|
||||
attachments = [{mimeType: "text/html", title: data.title, url: data.url}];
|
||||
}
|
||||
|
||||
return [201,
|
||||
"application/json",
|
||||
JSON.stringify({ saveSingleFile: !data.skipSnapshot && !data.pdf })];
|
||||
JSON.stringify({ saveSingleFile: !data.skipSnapshot && !data.pdf && data.singleFile, attachments })];
|
||||
},
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue