updates
This commit is contained in:
@@ -90,8 +90,11 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
for (const attachment of attachments) {
|
||||
try {
|
||||
// Determine which bucket to use
|
||||
const bucket = attachment.bucket || 'client-portal'; // Default to client-portal
|
||||
|
||||
// Download file from MinIO
|
||||
const stream = await client.getObject('portnimaradev', attachment.path);
|
||||
const stream = await client.getObject(bucket, attachment.path);
|
||||
const chunks: Buffer[] = [];
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
@@ -107,7 +110,7 @@ export default defineEventHandler(async (event) => {
|
||||
content: content
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Failed to attach file ${attachment.name}:`, error);
|
||||
console.error(`Failed to attach file ${attachment.name} from bucket ${attachment.bucket}:`, error);
|
||||
// Continue with other attachments
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user