mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +02:00
Add covers for cards
This commit is contained in:
parent
6a68ec9c1e
commit
49dc28b0d7
26 changed files with 315 additions and 98 deletions
|
@ -51,6 +51,7 @@ module.exports = {
|
|||
|
||||
const attachment = await sails.helpers.createAttachment(
|
||||
card,
|
||||
currentUser,
|
||||
{
|
||||
dirname: file.extra.dirname,
|
||||
filename: file.filename,
|
||||
|
|
|
@ -27,7 +27,7 @@ module.exports = {
|
|||
.intercept('pathNotFound', () => Errors.ATTACHMENT_NOT_FOUND);
|
||||
|
||||
let { attachment } = attachmentToProjectPath;
|
||||
const { board, project } = attachmentToProjectPath;
|
||||
const { card, board, project } = attachmentToProjectPath;
|
||||
|
||||
const isUserMemberForProject = await sails.helpers.isUserMemberForProject(
|
||||
project.id,
|
||||
|
@ -38,7 +38,7 @@ module.exports = {
|
|||
throw Errors.ATTACHMENT_NOT_FOUND; // Forbidden
|
||||
}
|
||||
|
||||
attachment = await sails.helpers.deleteAttachment(attachment, board, this.req);
|
||||
attachment = await sails.helpers.deleteAttachment(attachment, card, board, this.req);
|
||||
|
||||
if (!attachment) {
|
||||
throw Errors.ATTACHMENT_NOT_FOUND;
|
||||
|
|
|
@ -20,6 +20,11 @@ module.exports = {
|
|||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
},
|
||||
coverAttachmentId: {
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
allowNull: true,
|
||||
},
|
||||
position: {
|
||||
type: 'number',
|
||||
},
|
||||
|
@ -91,6 +96,7 @@ module.exports = {
|
|||
}
|
||||
|
||||
const values = _.pick(inputs, [
|
||||
'coverAttachmentId',
|
||||
'position',
|
||||
'name',
|
||||
'description',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue