diff --git a/lib/AppLoader.js b/lib/AppLoader.js index 7294672..261b258 100644 --- a/lib/AppLoader.js +++ b/lib/AppLoader.js @@ -40,7 +40,7 @@ function startWatchers(dbStore, path, contextBuilder) { try { if (w.hasOwnProperty('actionData')) { const { entity, action, filter, actionData } = w; - const filter2 = typeof filter === 'function' ? filter() : filter; + const filter2 = typeof filter === 'function' ? await filter() : filter; const data = typeof actionData === 'function' ? await actionData() : actionData; // 这里有个奇怪的编译错误,不理解 by Xc const result = await dbStore.operate(entity, { id: await (0, uuid_1.generateNewIdAsync)(), diff --git a/src/AppLoader.ts b/src/AppLoader.ts index 65a958c..7c2c55b 100644 --- a/src/AppLoader.ts +++ b/src/AppLoader.ts @@ -63,7 +63,7 @@ function startWatchers>w; - const filter2 = typeof filter === 'function' ? filter() : filter; + const filter2 = typeof filter === 'function' ? await filter() : filter; const data = typeof actionData === 'function' ? await (actionData as any)() : actionData; // 这里有个奇怪的编译错误,不理解 by Xc const result = await dbStore.operate(entity, { id: await generateNewIdAsync(),