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:
parent
e7495e0067
commit
6268ced4cb
10 changed files with 102 additions and 86 deletions
|
@ -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,
|
||||
|
|
|
@ -46,7 +46,7 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
|
||||
if (!attachment.isImage) {
|
||||
if (!attachment.image) {
|
||||
throw Errors.ATTACHMENT_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue