Tidying up debugging console statements and comments
This commit is contained in:
parent
b1496be3d3
commit
a764bfb6a5
|
@ -7,22 +7,15 @@
|
||||||
notifications,
|
notifications,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
import { automationStore } from "stores/builder"
|
import { automationStore, tables } from "stores/builder"
|
||||||
import { TriggerStepID } from "constants/backend/automations"
|
import { TriggerStepID } from "constants/backend/automations"
|
||||||
import { tables } from "stores/builder"
|
|
||||||
import { goto } from "@roxi/routify"
|
import { goto } from "@roxi/routify"
|
||||||
|
|
||||||
const { datasource } = getContext("grid")
|
const { datasource } = getContext("grid")
|
||||||
|
|
||||||
// ROW_SAVED
|
|
||||||
// ROW_UPDATED
|
|
||||||
$: console.log($datasource)
|
|
||||||
$: triggers = $automationStore.blockDefinitions.TRIGGER
|
$: triggers = $automationStore.blockDefinitions.TRIGGER
|
||||||
|
|
||||||
$: table = $tables.list.find(table => table._id === $datasource.tableId)
|
$: table = $tables.list.find(table => table._id === $datasource.tableId)
|
||||||
$: console.log("table", table)
|
|
||||||
// $: rowCreateTrigger = triggers[TriggerStepID.ROW_SAVED]
|
|
||||||
// $: rowUpdateTrigger = triggers[TriggerStepID.ROW_UPDATED]
|
|
||||||
|
|
||||||
async function createAutomation(type) {
|
async function createAutomation(type) {
|
||||||
const triggerType = triggers[type]
|
const triggerType = triggers[type]
|
||||||
|
@ -48,13 +41,7 @@
|
||||||
|
|
||||||
triggerBlock.inputs = { tableId: $datasource.tableId }
|
triggerBlock.inputs = { tableId: $datasource.tableId }
|
||||||
|
|
||||||
// need to set inputs to { "tableId": "ta_bb_employee" },
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log("REQ", {
|
|
||||||
automationName,
|
|
||||||
triggerBlock,
|
|
||||||
})
|
|
||||||
const response = await automationStore.actions.create(
|
const response = await automationStore.actions.create(
|
||||||
automationName,
|
automationName,
|
||||||
triggerBlock
|
triggerBlock
|
||||||
|
@ -90,7 +77,6 @@
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
open = false
|
open = false
|
||||||
createAutomation(TriggerStepID.ROW_SAVED)
|
createAutomation(TriggerStepID.ROW_SAVED)
|
||||||
console.log("create")
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Automation: when row is created
|
Automation: when row is created
|
||||||
|
@ -100,7 +86,6 @@
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
open = false
|
open = false
|
||||||
createAutomation(TriggerStepID.ROW_UPDATED)
|
createAutomation(TriggerStepID.ROW_UPDATED)
|
||||||
console.log("update")
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Automation: when row is updated
|
Automation: when row is updated
|
||||||
|
|
Loading…
Reference in New Issue