mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
db/events: simplify it further
This commit is contained in:
parent
b39902d322
commit
f6a8ab570f
1 changed files with 3 additions and 5 deletions
|
|
@ -155,11 +155,9 @@ function getFilterQuery(filter: DittoFilter): EventQuery {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof filter.local === 'boolean') {
|
if (typeof filter.local === 'boolean') {
|
||||||
query = filter.local
|
query = query
|
||||||
? query.leftJoin(usersQuery, (join) => join.onRef('users.d_tag', '=', 'events.pubkey'))
|
.leftJoin(usersQuery, (join) => join.onRef('users.d_tag', '=', 'events.pubkey'))
|
||||||
.where('users.d_tag', 'is not', null)
|
.where('users.d_tag', filter.local ? 'is not' : 'is', null);
|
||||||
: query.leftJoin(usersQuery, (join) => join.onRef('users.d_tag', '=', 'events.pubkey'))
|
|
||||||
.where('users.d_tag', 'is', null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter.relations?.includes('author')) {
|
if (filter.relations?.includes('author')) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue