Hot fix delete file
This commit is contained in:
parent
399f98ea72
commit
08f2b0ea02
@ -49,10 +49,11 @@ export default class FilesService extends BaseService {
|
||||
*/
|
||||
public async delete(uid: string) {
|
||||
const fileToUnpin = await this.filesRepository.findOneByUid(uid);
|
||||
if(!fileToUnpin) throw new Error("File not found");
|
||||
const decryptedFilePath = await this.cryptoService.decrypt(fileToUnpin.file_path, fileToUnpin.iv);
|
||||
const fileHash= decryptedFilePath.substring(this.variables.PINATA_GATEWAY.length);
|
||||
await this.ipfsService.unpinFile(fileHash)
|
||||
if(fileToUnpin){
|
||||
const decryptedFilePath = await this.cryptoService.decrypt(fileToUnpin.file_path, fileToUnpin.iv);
|
||||
const fileHash= decryptedFilePath.substring(this.variables.PINATA_GATEWAY.length);
|
||||
await this.ipfsService.unpinFile(fileHash)
|
||||
}
|
||||
return this.filesRepository.delete(uid);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user