Skip to content

Commit 5a3aa22

Browse files
committed
fix: bring back filters
1 parent 513107c commit 5a3aa22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apps/api/src/query/simple-builder.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export class SimpleQueryBuilder {
1111
) { }
1212

1313
private buildFilter(filter: Filter, index: number): { clause: string, params: Record<string, unknown> } {
14+
if (this.config.allowedFilters && !this.config.allowedFilters.includes(filter.field)) {
15+
throw new Error(`Filter on field '${filter.field}' is not permitted.`);
16+
}
1417
const key = `f${index}`;
1518
const operator = FilterOperators[filter.op];
1619

0 commit comments

Comments
 (0)