perf(server): Improve following/followers API performance

Related #6813
This commit is contained in:
syuilo 2021-03-21 10:41:21 +09:00
parent d91d7a36c4
commit 517e6ad17a
2 changed files with 4 additions and 2 deletions

View file

@ -76,7 +76,8 @@ export default define(meta, async (ps, me) => {
}
const query = makePaginationQuery(Followings.createQueryBuilder('following'), ps.sinceId, ps.untilId)
.andWhere(`following.followeeId = :userId`, { userId: user.id });
.andWhere(`following.followeeId = :userId`, { userId: user.id })
.innerJoinAndSelect('following.follower', 'follower');
const followings = await query
.take(ps.limit!)

View file

@ -76,7 +76,8 @@ export default define(meta, async (ps, me) => {
}
const query = makePaginationQuery(Followings.createQueryBuilder('following'), ps.sinceId, ps.untilId)
.andWhere(`following.followerId = :userId`, { userId: user.id });
.andWhere(`following.followerId = :userId`, { userId: user.id })
.innerJoinAndSelect('following.followee', 'followee');
const followings = await query
.take(ps.limit!)