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