mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-29 13:59:26 +01:00
Improve performance of notes/following API
This commit is contained in:
parent
6ed38f53f5
commit
03559156b9
1 changed files with 9 additions and 9 deletions
|
@ -103,6 +103,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
sub.andWhere('latest.is_quote = false');
|
||||
}
|
||||
|
||||
// Select the appropriate collection of users
|
||||
if (ps.list === 'followers') {
|
||||
addFollower(sub);
|
||||
} else if (ps.list === 'following') {
|
||||
addFollowee(sub);
|
||||
} else {
|
||||
addMutual(sub);
|
||||
}
|
||||
|
||||
return sub;
|
||||
},
|
||||
'latest',
|
||||
|
@ -118,15 +127,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
.leftJoinAndSelect('note.channel', 'channel')
|
||||
;
|
||||
|
||||
// Select the appropriate collection of users
|
||||
if (ps.list === 'followers') {
|
||||
addFollower(query);
|
||||
} else if (ps.list === 'following') {
|
||||
addFollowee(query);
|
||||
} else {
|
||||
addMutual(query);
|
||||
}
|
||||
|
||||
// Limit to files, if requested
|
||||
if (ps.filesOnly) {
|
||||
query.andWhere('note."fileIds" != \'{}\'');
|
||||
|
|
Loading…
Reference in a new issue