mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 11:03:48 +01:00
update doc to file
This commit is contained in:
parent
5032018257
commit
2b84cd0b11
@ -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…
Reference in New Issue
Block a user