mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-28 21:08:52 -07:00
[backend] Make postgres FTS filter: filters slightly more typo-safe
This commit is contained in:
parent
b7a5c192d8
commit
b2f6808bef
2 changed files with 4 additions and 4 deletions
|
@ -147,9 +147,9 @@ function miscFilter(query: SelectQueryBuilder<any>, filter: string) {
|
||||||
subQuery = Followings.createQueryBuilder('following')
|
subQuery = Followings.createQueryBuilder('following')
|
||||||
.select('following.followeeId')
|
.select('following.followeeId')
|
||||||
.where('following.followerId = :meId')
|
.where('following.followerId = :meId')
|
||||||
} else if (filter === 'replies') {
|
} else if (filter === 'replies' || filter === 'reply') {
|
||||||
query.andWhere('note.replyId IS NOT NULL');
|
query.andWhere('note.replyId IS NOT NULL');
|
||||||
} else if (filter === 'boosts' || filter === 'renotes') {
|
} else if (filter === 'boosts' || filter === 'boost' || filter === 'renotes' || filter === 'renote') {
|
||||||
query.andWhere('note.renoteId IS NOT NULL');
|
query.andWhere('note.renoteId IS NOT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ function miscFilterInverse(query: SelectQueryBuilder<any>, filter: string) {
|
||||||
.where('following.followerId = :meId')
|
.where('following.followerId = :meId')
|
||||||
} else if (filter === 'replies') {
|
} else if (filter === 'replies') {
|
||||||
query.andWhere('note.replyId IS NULL');
|
query.andWhere('note.replyId IS NULL');
|
||||||
} else if (filter === 'boosts' || filter === 'renotes') {
|
} else if (filter === 'boosts' || filter === 'boost' || filter === 'renotes' || filter === 'renote') {
|
||||||
query.andWhere('note.renoteId IS NULL');
|
query.andWhere('note.renoteId IS NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<div class="section _block">
|
<div class="section _block">
|
||||||
<div class="title">{{ i18n.ts._filters._dialog.miscFilters }}</div>
|
<div class="title">{{ i18n.ts._filters._dialog.miscFilters }}</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p><code>[-]filter:followers|following|replies|renotes|boosts</code></p>
|
<p><code>[-]filter:followers|following|replies|reply|renote[s]|boost[s]</code></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="section _block">
|
<div class="section _block">
|
||||||
|
|
Loading…
Reference in a new issue