fix calls to automations.save, which doesn't need the instanceId

This commit is contained in:
Maurits Lourens 2021-08-26 15:58:24 +02:00
parent 3da6577348
commit 7f9e8fa321
2 changed files with 3 additions and 11 deletions

View File

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

View File

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