feat: wip upload documents

This commit is contained in:
Ahmed Bouhuolia
2024-05-24 14:28:21 +02:00
parent 1227111fae
commit c8f31f33be
13 changed files with 6353 additions and 6211 deletions

View File

@@ -0,0 +1,19 @@
import { DeleteObjectCommand } from '@aws-sdk/client-s3';
import { s3 } from '@/lib/S3/S3';
import { Service } from 'typedi';
@Service()
export class DeleteAttachment {
/**
* Deletes the give file attachment file key.
* @param {number} tenantId
* @param {string} filekey
*/
async delete(tenantId: number, filekey: string): Promise<void> {
const params = {
Bucket: process.env.AWS_BUCKET,
Key: filekey,
};
await s3.send(new DeleteObjectCommand(params));
}
}