Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit 12287f4

Browse files
committed
fix(countEntities): Uses constructFilter.
1 parent 3e0124c commit 12287f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/functions/countEntities.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import filterEntities from '../utils/filterEntities';
66
export default <E extends Entity>(config: FacadeConfig<E>): CountEntities<E> => {
77
return async ({ filter = {} }) => {
88
const table = (await config.db()).table(config.tableName);
9-
const [result] = await Promise.resolve(filterEntities(table, filter).count());
9+
const constructedFilter = config.constructFilter(filter);
10+
const [result] = await Promise.resolve(filterEntities(table, constructedFilter).count());
1011
return { count: result['count(*)'] };
1112
};
1213
};

0 commit comments

Comments
 (0)