mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
db/events: skip undefined filter values
This commit is contained in:
parent
fecd69bf8f
commit
c37dd2c2b5
1 changed files with 3 additions and 1 deletions
|
|
@ -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!);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue