fix merge conflicts, make arguments more consistent
This commit is contained in:
parent
1116b1de16
commit
931ec7bfd9
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -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.`
|
||||
|
|
|
@ -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
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -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"
|
||||
>
|
||||
|
|
|
@ -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.`)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue