added more hooks

This commit is contained in:
subnub
2024-06-22 03:46:42 -04:00
parent ecca46c73e
commit 4cccd43677
11 changed files with 430 additions and 357 deletions
+2
View File
@@ -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");