mirror of
https://github.com/plankanban/planka.git
synced 2025-12-19 09:13:20 +03:00
feat: Move webhooks configuration from environment variable to UI
This commit is contained in:
@@ -82,8 +82,11 @@ module.exports = {
|
||||
inputs.request,
|
||||
);
|
||||
|
||||
const webhooks = await Webhook.qm.getAll();
|
||||
|
||||
sails.helpers.utils.sendWebhooks.with({
|
||||
event: 'taskCreate',
|
||||
webhooks,
|
||||
event: Webhook.Events.TASK_CREATE,
|
||||
buildData: () => ({
|
||||
item: task,
|
||||
included: {
|
||||
|
||||
@@ -51,8 +51,11 @@ module.exports = {
|
||||
inputs.request,
|
||||
);
|
||||
|
||||
const webhooks = await Webhook.qm.getAll();
|
||||
|
||||
sails.helpers.utils.sendWebhooks.with({
|
||||
event: 'taskDelete',
|
||||
webhooks,
|
||||
event: Webhook.Events.TASK_DELETE,
|
||||
buildData: () => ({
|
||||
item: task,
|
||||
included: {
|
||||
|
||||
@@ -112,8 +112,11 @@ module.exports = {
|
||||
inputs.request,
|
||||
);
|
||||
|
||||
const webhooks = await Webhook.qm.getAll();
|
||||
|
||||
sails.helpers.utils.sendWebhooks.with({
|
||||
event: 'taskUpdate',
|
||||
webhooks,
|
||||
event: Webhook.Events.TASK_UPDATE,
|
||||
buildData: () => ({
|
||||
item: task,
|
||||
included: {
|
||||
@@ -135,6 +138,7 @@ module.exports = {
|
||||
|
||||
if (inputs.record.isCompleted !== task.isCompleted) {
|
||||
await sails.helpers.actions.createOne.with({
|
||||
webhooks,
|
||||
values: {
|
||||
type: task.isCompleted ? Action.Types.COMPLETE_TASK : Action.Types.UNCOMPLETE_TASK,
|
||||
data: {
|
||||
|
||||
Reference in New Issue
Block a user