Skip to content

Commit e0b9e36

Browse files
author
Vincent Molinié
committed
chore: fix filter on smart field to be asynchrone
1 parent b636536 commit e0b9e36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/filters-parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ function FiltersParser(model, timezone, options) {
6464
throw new Error(`"filter" method missing on smart field "${fieldFound.field}"`);
6565
}
6666

67-
const formattedCondition = fieldFound
67+
const formattedCondition = await Promise.resolve(fieldFound
6868
.filter({
6969
where: await this.formatOperatorValue(
7070
condition.field,
7171
condition.operator,
7272
condition.value,
7373
),
7474
condition,
75-
});
75+
}));
7676
if (!formattedCondition) {
7777
throw new Error(`"filter" method on smart field "${fieldFound.field}" must return a condition`);
7878
}

0 commit comments

Comments
 (0)