@ -34,7 +34,11 @@ async function archiveToPath(zip) {
|
|||||||
|
|
||||||
export async function archiveCollection(collection: Collection) {
|
export async function archiveCollection(collection: Collection) {
|
||||||
const zip = new JSZip();
|
const zip = new JSZip();
|
||||||
await addToArchive(zip, collection.documentStructure);
|
|
||||||
|
if (collection.documentStructure) {
|
||||||
|
await addToArchive(zip, collection.documentStructure);
|
||||||
|
}
|
||||||
|
|
||||||
return archiveToPath(zip);
|
return archiveToPath(zip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,8 +46,10 @@ export async function archiveCollections(collections: Collection[]) {
|
|||||||
const zip = new JSZip();
|
const zip = new JSZip();
|
||||||
|
|
||||||
for (const collection of collections) {
|
for (const collection of collections) {
|
||||||
const folder = zip.folder(collection.name);
|
if (collection.documentStructure) {
|
||||||
await addToArchive(folder, collection.documentStructure);
|
const folder = zip.folder(collection.name);
|
||||||
|
await addToArchive(folder, collection.documentStructure);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return archiveToPath(zip);
|
return archiveToPath(zip);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user