db/events: skip undefined filter values

This commit is contained in:
Alex Gleason 2023-08-19 12:59:22 -05:00
parent fecd69bf8f
commit c37dd2c2b5
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 3 additions and 1 deletions

View File

@ -64,7 +64,9 @@ function getFilterQuery(filter: DittoFilter) {
])
.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) {
case 'ids':
query = query.where('events.id', 'in', filter.ids!);