feat(journal): preview last attachments and photos in report card

This commit is contained in:
dev
2026-10-15 16:36:46 +03:00
parent 3150d41fa5
commit d93b51e859
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -9267,6 +9267,12 @@ app.get('/api/files/:token', fileLimiter, async (req, res) => {
if (!key) return res.status(404).json({ error: 'File missing' });
if (isImageName(r.name)) {
if (req.query.thumb) return sendImageThumb(res, key);
if (req.query.download) {
if (!(await storage.streamTo(res, key, { download: true, name: r.name })) && !res.headersSent) {
return res.status(404).json({ error: 'File missing' });
}
return;
}
const ok = await storage.streamTo(res, key, { cacheControl: 'public, max-age=31536000, immutable' });
if (!ok && !res.headersSent) return res.status(404).json({ error: 'File missing' });
return;