redone routes

This commit is contained in:
2025-12-07 22:27:57 +01:00
parent b90e056e7c
commit 09d67a7522

View File

@@ -254,7 +254,17 @@ export default async function fileRoutes(server: FastifyInstance) {
.from(files)
.where(eq(files.tenant, tenantId))
const selected = rows.filter(f => ids.includes(f.id))
const selected = rows.filter(f => ids.includes(f.id) && f.path)
console.log(selected)
const url = await getSignedUrl(
s3,
new GetObjectCommand({ Bucket: secrets.S3_BUCKET, Key: selected[0].path! }),
{ expiresIn: 900 }
)
console.log(url)
console.log(selected.filter(f => !f.path))
const output = await Promise.all(
selected.map(async (file) => {