destructure encryptedFile and encryptedKey into seperate variables

This commit is contained in:
Abhinav-grd 2021-02-25 23:02:17 +05:30
parent da450da0f9
commit 7d53d9f239

View file

@ -157,22 +157,26 @@ class UploadService {
) {
try {
let file: FileinMemory = await this.readFile(reader, rawFile);
let encryptedFile: EncryptedFile = await this.encryptFile(
let {
file: encryptedFile,
fileKey: encryptedKey,
}: EncryptedFile = await this.encryptFile(
worker,
file,
collection.key
);
file = null;
let backupedFile: BackupedFile = await this.uploadtoBucket(
encryptedFile.file,
encryptedFile,
token
);
encryptedFile = null;
let uploadFile: uploadFile = this.getuploadFile(
collection,
backupedFile,
encryptedFile.fileKey
encryptedKey
);
encryptedFile = null;
backupedFile = null;
await this.uploadFile(uploadFile, token);
uploadFile = null;