fix merge conflicts, make arguments more consistent

This commit is contained in:
Maurits Lourens 2021-09-16 23:20:31 +02:00
parent 1116b1de16
commit 931ec7bfd9
8 changed files with 27 additions and 27 deletions

View File

@ -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()

View File

@ -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>

View File

@ -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.`

View File

@ -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>

View File

@ -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"
>

View File

@ -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.`)

View File

@ -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

View File

@ -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
}