mirror of
https://github.com/plankanban/planka.git
synced 2025-07-20 05:39:43 +02:00
Add covers for cards
This commit is contained in:
parent
f743f4ea8b
commit
3dffed90c6
26 changed files with 315 additions and 98 deletions
|
@ -7,6 +7,10 @@ module.exports = {
|
|||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
card: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
board: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
|
@ -17,6 +21,16 @@ module.exports = {
|
|||
},
|
||||
|
||||
async fn(inputs, exits) {
|
||||
if (inputs.record.id === inputs.card.coverAttachmentId) {
|
||||
await sails.helpers.updateCard.with({
|
||||
record: inputs.card,
|
||||
values: {
|
||||
coverAttachmentId: null,
|
||||
},
|
||||
request: inputs.request,
|
||||
});
|
||||
}
|
||||
|
||||
const attachment = await Attachment.archiveOne(inputs.record.id);
|
||||
|
||||
if (attachment) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue