type errors

This commit is contained in:
Peter Clement 2024-12-20 14:54:37 +00:00
parent cfc56277fd
commit ac1b56db6f
2 changed files with 9 additions and 8 deletions

View File

@ -564,11 +564,12 @@ const automationActions = (store: AutomationStore) => ({
automation.definition.stepNames?.[pathBlock.id] || pathBlock.name automation.definition.stepNames?.[pathBlock.id] || pathBlock.name
let schema = cloneDeep(pathBlock?.schema?.outputs?.properties) ?? {} let schema = cloneDeep(pathBlock?.schema?.outputs?.properties) ?? {}
let isLoopBlock = false
const isLoopBlock = if (pathBlock.blockToLoop) {
pathBlock.stepId === ActionStepID.LOOP && isLoopBlock =
pathBlock.blockToLoop! in blocks pathBlock.stepId === ActionStepID.LOOP &&
pathBlock.blockToLoop in blocks
}
const isTrigger = pathBlock.type === AutomationStepType.TRIGGER const isTrigger = pathBlock.type === AutomationStepType.TRIGGER
if (isLoopBlock && loopBlockCount == 0) { if (isLoopBlock && loopBlockCount == 0) {

View File

@ -456,7 +456,7 @@ export function filterAutomation(appId: string, tableId?: string): Automation {
icon: "Icon", icon: "Icon",
id: "a", id: "a",
type: AutomationStepType.TRIGGER, type: AutomationStepType.TRIGGER,
event: "row:save", event: AutomationEventType.ROW_SAVE,
stepId: AutomationTriggerStepId.ROW_SAVED, stepId: AutomationTriggerStepId.ROW_SAVED,
inputs: { inputs: {
tableId: tableId!, tableId: tableId!,
@ -498,7 +498,7 @@ export function updateRowAutomationWithFilters(
icon: "Icon", icon: "Icon",
id: "a", id: "a",
type: AutomationStepType.TRIGGER, type: AutomationStepType.TRIGGER,
event: "row:update", event: AutomationEventType.ROW_UPDATE,
stepId: AutomationTriggerStepId.ROW_UPDATED, stepId: AutomationTriggerStepId.ROW_UPDATED,
inputs: { tableId }, inputs: { tableId },
schema: TRIGGER_DEFINITIONS.ROW_UPDATED.schema, schema: TRIGGER_DEFINITIONS.ROW_UPDATED.schema,
@ -513,7 +513,7 @@ export function basicAutomationResults(
return { return {
automationId, automationId,
status: AutomationStatus.SUCCESS, status: AutomationStatus.SUCCESS,
trigger: "trigger", trigger: "trigger" as any,
steps: [ steps: [
{ {
stepId: AutomationActionStepId.SERVER_LOG, stepId: AutomationActionStepId.SERVER_LOG,