Skip to content

Commit 143e16d

Browse files
authored
fix: fix filtering by bool (#97)(@heisenme)
1 parent 0a16980 commit 143e16d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/utils/convert-filter.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,28 @@ const convertFilter = (filter) => {
4141
],
4242
};
4343
}
44+
case 'boolean': {
45+
let bool;
46+
if (value === 'true') bool = true;
47+
if (value === 'false') bool = false;
48+
if (bool === undefined) return memo;
49+
50+
if (isArray) {
51+
return {
52+
...memo,
53+
[property.name()]: {
54+
[Op.in]: [
55+
...(previousValue[Op.in] || []),
56+
bool,
57+
],
58+
},
59+
};
60+
}
61+
return {
62+
...memo,
63+
[property.name()]: bool,
64+
};
65+
}
4466
case 'number': {
4567
if (!Number.isNaN(Number(value))) {
4668
if (isArray) {

0 commit comments

Comments
 (0)