From 4dedde5165b9c876480e8077f5bbe63ad55d9ee3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 24 Oct 2024 13:51:44 +0200 Subject: [PATCH] Add missing rowaction --- .../server/src/events/AutomationEmitter.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/server/src/events/AutomationEmitter.ts b/packages/server/src/events/AutomationEmitter.ts index ec1ea7f28c..a95acd0877 100644 --- a/packages/server/src/events/AutomationEmitter.ts +++ b/packages/server/src/events/AutomationEmitter.ts @@ -1,7 +1,15 @@ import { rowEmission, tableEmission } from "./utils" import mainEmitter from "./index" import env from "../environment" -import { Table, Row, DocumentType, App, ContextEmitter } from "@budibase/types" +import { + Table, + Row, + DocumentType, + App, + ContextEmitter, + EventType, + UserBindings, +} from "@budibase/types" import { context } from "@budibase/backend-core" const MAX_AUTOMATIONS_ALLOWED = 5 @@ -36,11 +44,15 @@ class AutomationEmitter implements ContextEmitter { appId, row, table, + oldRow, + user, }: { - eventName: string + eventName: EventType.ROW_SAVE | EventType.ROW_DELETE | EventType.ROW_UPDATE appId: string row: Row table?: Table + oldRow?: Row + user: UserBindings }) { let MAX_AUTOMATION_CHAIN = await this.getMaxAutomationChain() @@ -54,7 +66,9 @@ class AutomationEmitter implements ContextEmitter { appId, row, table, + oldRow, metadata: this.metadata, + user, }) }