Browse Source

update doc to file

pull/6/head
Casper Lamboo 4 years ago
parent
commit
2b84cd0b11
  1. 6
      src/shape/docToFile.js

6
src/shape/docToFile.js

@ -34,7 +34,11 @@ export default async function docToFile(db, doc, { image = false, sketch = false
}
}
if (image) {
response.img = `${db.name}/${doc._id}/img`;
if (!(doc._attachments && doc._attachments.img && doc._attachments.img.data)) {
throw new Error(`'${doc.name}' doesn't include image attachment`);
}
response.img = URL.createObjectURL(doc._attachments.img.data);
}
return response;

Loading…
Cancel
Save