1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

Add covers for cards

This commit is contained in:
Maksim Eltyshev 2020-04-23 03:02:53 +05:00
parent 6a68ec9c1e
commit 49dc28b0d7
26 changed files with 315 additions and 98 deletions

View file

@ -42,14 +42,19 @@ module.exports = {
required: true,
columnName: 'card_id',
},
userId: {
model: 'User',
required: true,
columnName: 'user_id',
},
},
customToJSON() {
return {
..._.omit(this, ['dirname', 'filename', 'isImage']),
url: `${sails.config.custom.attachmentsUrl}/${this.dirname}/${this.filename}`,
thumbnailUrl: this.isImage
? `${sails.config.custom.attachmentsUrl}/${this.dirname}/240.jpg`
coverUrl: this.isImage
? `${sails.config.custom.attachmentsUrl}/${this.dirname}/thumbnails/cover-256.jpg`
: null,
};
},