diff --git a/packages/builder/src/builderStore/store/automation/index.js b/packages/builder/src/builderStore/store/automation/index.js index b816a2c26d..e60553070b 100644 --- a/packages/builder/src/builderStore/store/automation/index.js +++ b/packages/builder/src/builderStore/store/automation/index.js @@ -78,11 +78,11 @@ const automationActions = store => ({ return state }) }, - trigger: async ({ automation }) => { + trigger: async automation => { const { _id } = automation return await api.post(`/api/automations/${_id}/trigger`) }, - test: async ({ automation }, testData) => { + test: async (automation, testData) => { const { _id } = automation const response = await api.post(`/api/automations/${_id}/test`, testData) const json = await response.json() diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte index 8820259e90..9af78df1b6 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte @@ -38,10 +38,9 @@ actionVal ) automationStore.actions.addBlockToAutomation(newBlock) - await automationStore.actions.save({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) } diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte index 53a5de3b51..92cc6e7cee 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte @@ -32,16 +32,15 @@ } async function deleteAutomation() { - await automationStore.actions.delete({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.delete( + $automationStore.selectedAutomation?.automation + ) } async function testAutomation() { - const result = await automationStore.actions.trigger({ - automation: $automationStore.selectedAutomation.automation, - }) + const result = await automationStore.actions.trigger( + $automationStore.selectedAutomation.automation + ) if (result.status === 200) { notifications.success( `Automation ${$automationStore.selectedAutomation.automation.name} triggered successfully.` diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 5898537dae..f077ac35d7 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -52,10 +52,9 @@ async function deleteStep() { automationStore.actions.deleteAutomationBlock(block) - await automationStore.actions.save({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) } diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte index d05c8fa326..8caba9d351 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte @@ -42,7 +42,10 @@ disabled={isError} onConfirm={() => { automationStore.actions.addTestDataToAutomation(testData) - automationStore.actions.test($automationStore.selectedAutomation, testData) + automationStore.actions.test( + $automationStore.selectedAutomation?.automation, + testData + ) }} cancelText="Cancel" > diff --git a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte index e774c366a5..6580cd0b87 100644 --- a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte @@ -29,10 +29,9 @@ webhookModal.show } - await automationStore.actions.save({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) notifications.success(`Automation ${name} created.`) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 8e6cb42ee2..ea3c60932c 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -56,10 +56,9 @@ testData[key] = e.detail } else { block.inputs[key] = e.detail - await automationStore.actions.save({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) } }, isTestModal ? 0 : 800 diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte index 9e39fd48e9..09a8b491c7 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte @@ -46,7 +46,9 @@ } automationStore.actions.addBlockToAutomation(newBlock) - await automationStore.actions.save($automationStore.selectedAutomation) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) parameters.automationId = $automationStore.selectedAutomation.automation._id delete parameters.newAutomationName }