mirror of
https://github.com/plankanban/planka.git
synced 2025-12-20 01:14:12 +03:00
feat: Move webhooks configuration from environment variable to UI
This commit is contained in:
@@ -214,6 +214,10 @@ module.exports = {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
webhooks: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs) {
|
||||
@@ -248,7 +252,8 @@ module.exports = {
|
||||
});
|
||||
|
||||
sails.helpers.utils.sendWebhooks.with({
|
||||
event: 'notificationCreate',
|
||||
webhooks: inputs.webhooks,
|
||||
event: Webhook.Events.NOTIFICATION_CREATE,
|
||||
buildData: () => ({
|
||||
item: notification,
|
||||
included: {
|
||||
|
||||
@@ -26,6 +26,8 @@ module.exports = {
|
||||
},
|
||||
);
|
||||
|
||||
const webhooks = await Webhook.qm.getAll();
|
||||
|
||||
notifications.forEach((notification) => {
|
||||
sails.sockets.broadcast(
|
||||
`user:${notification.userId}`,
|
||||
@@ -38,7 +40,8 @@ module.exports = {
|
||||
|
||||
// TODO: with prevData?
|
||||
sails.helpers.utils.sendWebhooks.with({
|
||||
event: 'notificationUpdate',
|
||||
webhooks,
|
||||
event: Webhook.Events.NOTIFICATION_UPDATE,
|
||||
buildData: () => ({
|
||||
item: notification,
|
||||
}),
|
||||
|
||||
@@ -37,8 +37,11 @@ module.exports = {
|
||||
inputs.request,
|
||||
);
|
||||
|
||||
const webhooks = await Webhook.qm.getAll();
|
||||
|
||||
sails.helpers.utils.sendWebhooks.with({
|
||||
event: 'notificationUpdate',
|
||||
webhooks,
|
||||
event: Webhook.Events.NOTIFICATION_UPDATE,
|
||||
buildData: () => ({
|
||||
item: notification,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user