Skip to content

Commit

Permalink
feat(Recursive Criteria): Enabling nested search criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Dickerson committed Jun 17, 2024
1 parent 61fa6f8 commit 54d39ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class CriteriaBuilderComponent implements OnInit, OnDestroy, AfterContent
const controls = Object.entries(data).reduce((obj, [key, val]) => {
return {
...obj,
[key]: this.formBuilder.array(val.map((it) => this.newCondition(it))),
[key]: this.formBuilder.array(val.map((it: Condition) => this.newCondition(it))),
};
}, {});
return this.formBuilder.group(controls);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ export enum Conjunction {
}

export type ConditionGroup = {
[K in Conjunction as `$${K}`]?: Condition[]
[K in Conjunction as `$${K}`]?: ConditionOrConjunctionGroup[];
};

export type ConditionOrConjunctionGroup = Condition | ConditionGroup;

export enum Operator {
after = 'after',
before = 'before',
Expand Down

0 comments on commit 54d39ab

Please sign in to comment.