Skip to content
Snippets Groups Projects
Commit 03559156 authored by Caramel's avatar Caramel
Browse files

Improve performance of notes/following API

parent 6ed38f53
No related branches found
No related tags found
2 merge requests!760Coordinated Security Release,!743Improve performance of notes/following API
......@@ -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" != \'{}\'');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment