added more hooks
This commit is contained in:
@@ -495,6 +495,8 @@ class FileController {
|
||||
const userID = req.user._id;
|
||||
const fileID = req.body.id;
|
||||
|
||||
console.log("id", fileID);
|
||||
|
||||
await this.chunkService.deleteFile(userID, fileID);
|
||||
|
||||
res.send();
|
||||
|
||||
@@ -172,7 +172,8 @@ class FileSystemService implements ChunkInterface {
|
||||
|
||||
const filePath = currentFile.metadata.filePath!;
|
||||
|
||||
const IV = currentFile.metadata.IV.buffer as Buffer;
|
||||
const IV = currentFile.metadata.IV;
|
||||
console.log("iv", IV);
|
||||
|
||||
const readStream = fs.createReadStream(filePath);
|
||||
|
||||
@@ -260,7 +261,7 @@ class FileSystemService implements ChunkInterface {
|
||||
if (!file) throw new NotFoundError("File Thumbnail Not Found");
|
||||
|
||||
const password = user.getEncryptionKey();
|
||||
const IV = file.metadata.IV.buffer as Buffer;
|
||||
const IV = file.metadata.IV;
|
||||
|
||||
if (!password) throw new ForbiddenError("Invalid Encryption Key");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user