From 1be08c6d4f83b7757c52d2b46c3be7cac4249de3 Mon Sep 17 00:00:00 2001 From: lxy Date: Fri, 21 Feb 2025 11:33:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E7=94=9F=E6=88=90accountOper=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9account=E4=B8=AD=E7=9A=84=E5=80=BC?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=90=91=E8=AE=A2=E9=98=85=E8=80=85=E6=8E=A8?= =?UTF-8?q?=E9=80=81=20trigger=E6=B7=BB=E5=8A=A0asRoot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/triggers/accountOper.js | 1 + lib/triggers/accountOper.js | 1 + src/triggers/accountOper.ts | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/es/triggers/accountOper.js b/es/triggers/accountOper.js index 91ecc9b3..f5160280 100644 --- a/es/triggers/accountOper.js +++ b/es/triggers/accountOper.js @@ -7,6 +7,7 @@ const triggers = [ entity: 'accountOper', action: 'create', when: 'before', + asRoot: true, fn: async ({ operation }, context, option) => { const { id, data } = operation; assert(!(data instanceof Array)); diff --git a/lib/triggers/accountOper.js b/lib/triggers/accountOper.js index 76838969..d54a6572 100644 --- a/lib/triggers/accountOper.js +++ b/lib/triggers/accountOper.js @@ -10,6 +10,7 @@ const triggers = [ entity: 'accountOper', action: 'create', when: 'before', + asRoot: true, fn: async ({ operation }, context, option) => { const { id, data } = operation; (0, assert_1.default)(!(data instanceof Array)); diff --git a/src/triggers/accountOper.ts b/src/triggers/accountOper.ts index 5ab2bb87..c82b44a3 100644 --- a/src/triggers/accountOper.ts +++ b/src/triggers/accountOper.ts @@ -11,6 +11,7 @@ const triggers: Trigger[] = [ entity: 'accountOper', action: 'create', when: 'before', + asRoot: true, fn: async ({ operation }, context, option) => { const { id, data } = operation; assert(!(data instanceof Array)); @@ -57,7 +58,7 @@ const triggers: Trigger[] = [ context.saveOperationToEvent(id, `${DATA_SUBSCRIBER_KEYS.accountNumberChanged}-${accountId}`); return 1; }, - } as CreateTriggerInTxn, + } as CreateTriggerInTxn, ]; export default triggers; \ No newline at end of file