fix: delete attachment from s3 (#272)

This commit is contained in:
Henry
2025-12-05 22:04:53 +00:00
committed by GitHub
parent d208952d15
commit 38f477bb5a
2 changed files with 24 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import {
DeleteObjectCommand,
GetObjectCommand,
PutObjectCommand,
S3Client,
@@ -56,3 +57,13 @@ export async function generateDownloadUrl(
{ expiresIn },
);
}
export async function deleteObject(bucket: string, key: string) {
const client = createS3Client();
await client.send(
new DeleteObjectCommand({
Bucket: bucket,
Key: key,
}),
);
}