mirror of
https://github.com/plankanban/planka.git
synced 2025-12-18 01:11:13 +03:00
feat: Move webhooks configuration from environment variable to UI
This commit is contained in:
@@ -31,6 +31,9 @@ module.exports = {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
webhooks: {
|
||||
type: 'ref',
|
||||
},
|
||||
request: {
|
||||
type: 'ref',
|
||||
},
|
||||
@@ -104,6 +107,8 @@ module.exports = {
|
||||
if (_.isEmpty(values)) {
|
||||
card = inputs.record;
|
||||
} else {
|
||||
const { webhooks = await Webhook.qm.getAll() } = inputs;
|
||||
|
||||
if (!_.isNil(values.position)) {
|
||||
const cards = await Card.qm.getByListId(list.id, {
|
||||
exceptIdOrIds: inputs.record.id,
|
||||
@@ -402,6 +407,7 @@ module.exports = {
|
||||
|
||||
const { id } = await sails.helpers.labels.createOne.with({
|
||||
project,
|
||||
webhooks,
|
||||
values: {
|
||||
..._.omit(label, ['id', 'boardId', 'createdAt', 'updatedAt']),
|
||||
board,
|
||||
@@ -459,6 +465,7 @@ module.exports = {
|
||||
|
||||
if (values.list) {
|
||||
await sails.helpers.actions.createOne.with({
|
||||
webhooks,
|
||||
values: {
|
||||
card,
|
||||
type: Action.Types.MOVE_CARD,
|
||||
@@ -477,7 +484,8 @@ module.exports = {
|
||||
}
|
||||
|
||||
sails.helpers.utils.sendWebhooks.with({
|
||||
event: 'cardUpdate',
|
||||
webhooks,
|
||||
event: Webhook.Events.CARD_UPDATE,
|
||||
buildData: () => ({
|
||||
item: card,
|
||||
included: {
|
||||
|
||||
Reference in New Issue
Block a user