enh
This commit is contained in:
parent
6b4f512d90
commit
b27e05aab0
4 changed files with 46529 additions and 11 deletions
Binary file not shown.
Binary file not shown.
46519
apps/backend/migration.sql
Normal file
46519
apps/backend/migration.sql
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -64,22 +64,21 @@ export async function deleteImageUtil({bucket = getS3BucketName(), keys}:{bucket
|
|||
return true;
|
||||
}
|
||||
try {
|
||||
const deleteParams = {
|
||||
Bucket: bucket,
|
||||
Delete: {
|
||||
Objects: keys.map((key) => ({ Key: key })),
|
||||
Quiet: false,
|
||||
}
|
||||
}
|
||||
|
||||
const deleteCommand = new DeleteObjectsCommand(deleteParams)
|
||||
await getS3Client().send(deleteCommand)
|
||||
const s3Client = getS3Client()
|
||||
await Promise.all(
|
||||
keys.map((key) => {
|
||||
const deleteCommand = new DeleteObjectCommand({
|
||||
Bucket: bucket,
|
||||
Key: key,
|
||||
})
|
||||
return s3Client.send(deleteCommand)
|
||||
})
|
||||
)
|
||||
return true
|
||||
}
|
||||
catch (error) {
|
||||
console.error("Error deleting image:", error)
|
||||
throw new Error("Failed to delete image")
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue