fix: 🐛 fix missing paths

pull/771/head
HannesOberreiter 2 years ago
parent 4ad14ed414
commit d9890181b7

@ -44,7 +44,7 @@ module.exports = {
async fn(inputs, exits) {
const { currentUser } = this.req;
const { card } = await sails.helpers.cards
const { card, board } = await sails.helpers.cards
.getProjectPath(inputs.cardId)
.intercept('pathNotFound', () => Errors.CARD_NOT_FOUND);
@ -88,6 +88,7 @@ module.exports = {
card,
creatorUser: currentUser,
},
board,
requestId: inputs.requestId,
request: this.req,
});

@ -36,7 +36,7 @@ module.exports = {
.intercept('pathNotFound', () => Errors.COMMENT_ACTION_NOT_FOUND);
let { action } = path;
const { board, project } = path;
const { board, project, card } = path;
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
@ -61,6 +61,7 @@ module.exports = {
action = await sails.helpers.actions.deleteOne.with({
board,
card,
record: action,
request: this.req,
});

@ -40,7 +40,7 @@ module.exports = {
.intercept('pathNotFound', () => Errors.COMMENT_ACTION_NOT_FOUND);
let { action } = path;
const { board, project } = path;
const { board, project, card } = path;
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
@ -69,6 +69,7 @@ module.exports = {
action = await sails.helpers.actions.updateOne.with({
values,
card,
board,
record: action,
request: this.req,

@ -28,7 +28,8 @@ module.exports = {
async fn(inputs) {
const { currentUser } = this.req;
let { list } = await sails.helpers.lists
// eslint-disable-next-line prefer-const
let { list, board } = await sails.helpers.lists
.getProjectPath(inputs.id)
.intercept('pathNotFound', () => Errors.LIST_NOT_FOUND);
@ -47,6 +48,7 @@ module.exports = {
list = await sails.helpers.lists.deleteOne.with({
record: list,
board,
request: this.req,
});

@ -62,8 +62,8 @@ module.exports = {
values: {
...values,
card,
board,
},
board,
request: this.req,
});

@ -4,6 +4,10 @@ module.exports = {
type: 'ref',
required: true,
},
card: {
type: 'ref',
required: true,
},
board: {
type: 'ref',
required: true,
@ -31,6 +35,7 @@ module.exports = {
data: action,
projectId: inputs.board.projectId,
user: inputs.request.currentUser,
card: inputs.card,
board: inputs.board,
});
}

@ -8,6 +8,10 @@ module.exports = {
type: 'json',
required: true,
},
card: {
type: 'ref',
required: true,
},
board: {
type: 'ref',
required: true,
@ -37,6 +41,7 @@ module.exports = {
data: action,
projectId: inputs.board.projectId,
user: inputs.request.currentUser,
card: inputs.card,
board: inputs.board,
});
}

@ -21,6 +21,10 @@ module.exports = {
custom: valuesValidator,
required: true,
},
board: {
type: 'ref',
required: true,
},
requestId: {
type: 'string',
isNotEmptyString: true,
@ -31,7 +35,7 @@ module.exports = {
},
async fn(inputs) {
const { values } = inputs;
const { values, board } = inputs;
const attachment = await Attachment.create({
...values,
@ -55,16 +59,18 @@ module.exports = {
values: {
coverAttachmentId: attachment.id,
},
board,
request: inputs.request,
});
}
await sails.helpers.utils.sendWebhook.with({
event: 'ATTACHMENT_CREATE',
data: attachment,
projectId: values.card.board.projectId,
projectId: board.projectId,
user: inputs.request.currentUser,
card: values.card,
board: values.card.board,
board,
});
return attachment;

@ -4,6 +4,10 @@ module.exports = {
type: 'ref',
required: true,
},
board: {
type: 'ref',
required: true,
},
request: {
type: 'ref',
},
@ -25,9 +29,9 @@ module.exports = {
await sails.helpers.utils.sendWebhook.with({
event: 'LIST_DELETE',
data: list,
projectId: list.board.projectId,
projectId: inputs.board.projectId,
user: inputs.request.currentUser,
board: list.board,
board: inputs.board,
});
}

Loading…
Cancel
Save