From 3bddd3b4712d5b616767f84089675af6c8b90458 Mon Sep 17 00:00:00 2001 From: "viktor.liablin" Date: Fri, 15 Dec 2023 11:23:51 +0200 Subject: [PATCH] Automations. App Logic trigger not work without req. body --- src/automations/index.js | 4 ++-- test/unit/specs/automations/basic.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/automations/index.js b/src/automations/index.js index e0cb4bfc..12b77279 100644 --- a/src/automations/index.js +++ b/src/automations/index.js @@ -37,9 +37,9 @@ export default class Automations { } return this.app.request.post({ - url : `${this.app.urls.automationFlowTrigger()}/activate-by-name`, + url : `${this.app.urls.automationFlowTrigger()}/activate-by-name`, query: { flowName, triggerName }, - data, + data : data || {}, }) } } diff --git a/test/unit/specs/automations/basic.js b/test/unit/specs/automations/basic.js index 60d0a498..80ff5690 100644 --- a/test/unit/specs/automations/basic.js +++ b/test/unit/specs/automations/basic.js @@ -78,6 +78,7 @@ describe(' Basic', function() { expect(req1).to.deep.include({ method: 'POST', path : `${APP_PATH}/automation/flow/trigger/activate-by-name?flowName=${FLOW_NAME}&triggerName=${TRIGGER_NAME}`, + body : {}, }) expect(req2).to.deep.include({