merge: Improve performance of notes/following API (!743)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/743 Approved-by: Hazelnoot <acomputerdog@gmail.com> Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
commit
cd2e597223
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');
|
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;
|
return sub;
|
||||||
},
|
},
|
||||||
'latest',
|
'latest',
|
||||||
|
@ -118,15 +127,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
.leftJoinAndSelect('note.channel', 'channel')
|
.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
|
// Limit to files, if requested
|
||||||
if (ps.filesOnly) {
|
if (ps.filesOnly) {
|
||||||
query.andWhere('note."fileIds" != \'{}\'');
|
query.andWhere('note."fileIds" != \'{}\'');
|
||||||
|
|
Loading…
Reference in a new issue