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

fix: Move webhooks declaration to correct position

This commit is contained in:
Maksim Eltyshev 2025-07-08 00:22:24 +02:00
parent 4346b7040a
commit 9d07178e57
2 changed files with 4 additions and 4 deletions

View file

@ -35,6 +35,8 @@ module.exports = {
}, },
async fn(inputs) { async fn(inputs) {
const webhooks = await Webhook.qm.getAll();
if (inputs.record.id === inputs.card.coverAttachmentId) { if (inputs.record.id === inputs.card.coverAttachmentId) {
await sails.helpers.cards.updateOne.with({ await sails.helpers.cards.updateOne.with({
webhooks, webhooks,
@ -67,8 +69,6 @@ module.exports = {
inputs.request, inputs.request,
); );
const webhooks = await Webhook.qm.getAll();
sails.helpers.utils.sendWebhooks.with({ sails.helpers.utils.sendWebhooks.with({
webhooks, webhooks,
event: Webhook.Events.ATTACHMENT_DELETE, event: Webhook.Events.ATTACHMENT_DELETE,

View file

@ -27,6 +27,8 @@ module.exports = {
record: inputs.project, record: inputs.project,
}); });
const webhooks = await Webhook.qm.getAll();
if (inputs.project.backgroundType === Project.BackgroundTypes.IMAGE) { if (inputs.project.backgroundType === Project.BackgroundTypes.IMAGE) {
if (inputs.record.id === inputs.project.backgroundImageId) { if (inputs.record.id === inputs.project.backgroundImageId) {
await sails.helpers.projects.updateOne.with({ await sails.helpers.projects.updateOne.with({
@ -59,8 +61,6 @@ module.exports = {
); );
}); });
const webhooks = await Webhook.qm.getAll();
sails.helpers.utils.sendWebhooks.with({ sails.helpers.utils.sendWebhooks.with({
webhooks, webhooks,
event: Webhook.Events.BACKGROUND_IMAGE_DELETE, event: Webhook.Events.BACKGROUND_IMAGE_DELETE,