This commit is contained in:
2025-06-10 14:32:20 +02:00
parent bd07939c3d
commit bb1a237961
8 changed files with 801 additions and 75 deletions

View File

@@ -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
}
}