fix calls to automations.save, which doesn't need the instanceId
This commit is contained in:
parent
3da6577348
commit
7f9e8fa321
|
@ -1,13 +1,11 @@
|
|||
<script>
|
||||
import { automationStore } from "builderStore"
|
||||
import { database } from "stores/backend"
|
||||
import { notifications, Button, Modal, Heading, Toggle } from "@budibase/bbui"
|
||||
import AutomationBlockSetup from "./AutomationBlockSetup.svelte"
|
||||
import CreateWebookModal from "../Shared/CreateWebhookModal.svelte"
|
||||
|
||||
let webhookModal
|
||||
|
||||
$: instanceId = $database._id
|
||||
$: automation = $automationStore.selectedAutomation?.automation
|
||||
$: automationLive = automation?.live
|
||||
|
||||
|
@ -16,7 +14,7 @@
|
|||
return
|
||||
}
|
||||
automation.live = live
|
||||
automationStore.actions.save({ instanceId, automation })
|
||||
automationStore.actions.save(automation)
|
||||
if (live) {
|
||||
notifications.info(`Automation ${automation.name} enabled.`)
|
||||
} else {
|
||||
|
@ -38,10 +36,7 @@
|
|||
}
|
||||
|
||||
async function saveAutomation() {
|
||||
await automationStore.actions.save({
|
||||
instanceId,
|
||||
automation,
|
||||
})
|
||||
await automationStore.actions.save(automation)
|
||||
notifications.success(`Automation ${automation.name} saved.`)
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -18,10 +18,7 @@
|
|||
onMount(async () => {
|
||||
if (!automation?.definition?.trigger?.inputs.schemaUrl) {
|
||||
// save the automation initially
|
||||
await automationStore.actions.save({
|
||||
instanceId,
|
||||
automation,
|
||||
})
|
||||
await automationStore.actions.save(automation)
|
||||
}
|
||||
interval = setInterval(async () => {
|
||||
await automationStore.actions.fetch()
|
||||
|
|
Loading…
Reference in New Issue