处理filter时没处理异步

This commit is contained in:
Xu Chang 2023-01-31 10:40:01 +08:00
parent 9b2ca17179
commit 5a868a3bb3
2 changed files with 2 additions and 2 deletions

View File

@ -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)(),

View File

@ -63,7 +63,7 @@ function startWatchers<ED extends EntityDict & BaseEntityDict, Cxt extends Async
try {
if (w.hasOwnProperty('actionData')) {
const { entity, action, filter, actionData } = <BBWatcher<ED, keyof ED>>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(),