1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-23 15:19:44 +02:00

ref: Collapse image data into one column

This commit is contained in:
Maksim Eltyshev 2022-06-21 12:01:41 +02:00
parent e7495e0067
commit 6268ced4cb
10 changed files with 102 additions and 86 deletions

View file

@ -54,10 +54,8 @@ module.exports = {
const attachment = await sails.helpers.attachments.createOne(
{
dirname: file.extra.dirname,
...file.extra,
filename: file.filename,
isImage: file.extra.isImage,
name: file.extra.name,
},
currentUser,
card,

View file

@ -46,7 +46,7 @@ module.exports = {
}
}
if (!attachment.isImage) {
if (!attachment.image) {
throw Errors.ATTACHMENT_NOT_FOUND;
}

View file

@ -53,7 +53,7 @@ module.exports = {
}
this.res.type(attachment.filename);
if (!attachment.isImage && path.extname(attachment.filename) !== '.pdf') {
if (!attachment.image && path.extname(attachment.filename) !== '.pdf') {
this.res.set('Content-Disposition', 'attachment');
}
this.res.set('Cache-Control', 'private, max-age=900'); // TODO: move to config