db/events: skip undefined filter values
This commit is contained in:
parent
fecd69bf8f
commit
c37dd2c2b5
|
@ -64,7 +64,9 @@ function getFilterQuery(filter: DittoFilter) {
|
||||||
])
|
])
|
||||||
.orderBy('events.created_at', 'desc');
|
.orderBy('events.created_at', 'desc');
|
||||||
|
|
||||||
for (const key of Object.keys(filter)) {
|
for (const [key, value] of Object.entries(filter)) {
|
||||||
|
if (value === undefined) continue;
|
||||||
|
|
||||||
switch (key as keyof DittoFilter) {
|
switch (key as keyof DittoFilter) {
|
||||||
case 'ids':
|
case 'ids':
|
||||||
query = query.where('events.id', 'in', filter.ids!);
|
query = query.where('events.id', 'in', filter.ids!);
|
||||||
|
|
Loading…
Reference in New Issue