Skip to content

Commit 2986c7b

Browse files
committed
fix: fix bug
1 parent a5100c1 commit 2986c7b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/persistence/src/record/record.filter-visitor.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,13 @@ export class RecordFilterVisitor extends AbstractQBVisitor<RecordDO> implements
172172
}
173173
}
174174
percentageEqual(spec: PercentageEqual): void {
175-
const cond = this.eb.eb(this.getFieldId(spec), "=", spec.value)
176-
this.addCond(cond)
177-
}
178-
percentageEqual(spec: PercentageEqual): void {
179-
const cond = this.eb.eb(this.getFieldId(spec), "=", spec.value)
180-
this.addCond(cond)
175+
if (!spec.value) {
176+
const cond = this.eb.eb(this.getFieldId(spec), "is", null).or(this.getFieldId(spec), "=", 0)
177+
this.addCond(cond)
178+
} else {
179+
const cond = this.eb.eb(this.getFieldId(spec), "=", spec.value)
180+
this.addCond(cond)
181+
}
181182
}
182183
stringMin(spec: StringMin): void {
183184
const cond = this.eb.eb(this.eb.fn("LENGTH", [this.getFieldId(spec)]), ">=", spec.min)

0 commit comments

Comments
 (0)