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');
|
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