fix: only create zip if more than one file is in the share

This commit is contained in:
Elias Schneider
2022-12-11 12:19:42 +01:00
parent 7c0d62a429
commit 3d1d4d0fc7
2 changed files with 12 additions and 13 deletions

View File

@@ -105,9 +105,10 @@ export class ShareService {
);
// Asynchronously create a zip of all files
this.createZip(id).then(() =>
this.prisma.share.update({ where: { id }, data: { isZipReady: true } })
);
if (share.files.length > 1)
this.createZip(id).then(() =>
this.prisma.share.update({ where: { id }, data: { isZipReady: true } })
);
// Send email for each recepient
for (const recepient of share.recipients) {