diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-03-20 13:54:59 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-03-20 13:54:59 +0900 |
| commit | f27e4033a6599203ba37efe01edbd988699b4068 (patch) | |
| tree | 39249a742055a53c9690f89fdbef8980e48fe01b /src/server/api/endpoints/notes/featured.ts | |
| parent | perf(server): Reduce database query (diff) | |
| download | sharkey-f27e4033a6599203ba37efe01edbd988699b4068.tar.gz sharkey-f27e4033a6599203ba37efe01edbd988699b4068.tar.bz2 sharkey-f27e4033a6599203ba37efe01edbd988699b4068.zip | |
perf(server): Reduce database query
Related: #6813
Diffstat (limited to 'src/server/api/endpoints/notes/featured.ts')
| -rw-r--r-- | src/server/api/endpoints/notes/featured.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/api/endpoints/notes/featured.ts b/src/server/api/endpoints/notes/featured.ts index 4dda7d0edb..6c416b1c04 100644 --- a/src/server/api/endpoints/notes/featured.ts +++ b/src/server/api/endpoints/notes/featured.ts @@ -49,7 +49,11 @@ export default define(meta, async (ps, user) => { .andWhere(`note.score > 0`) .andWhere(`note.createdAt > :date`, { date: new Date(Date.now() - day) }) .andWhere(`note.visibility = 'public'`) - .leftJoinAndSelect('note.user', 'user'); + .leftJoinAndSelect('note.user', 'user') + .leftJoinAndSelect('note.reply', 'reply') + .leftJoinAndSelect('note.renote', 'renote') + .leftJoinAndSelect('reply.user', 'replyUser') + .leftJoinAndSelect('renote.user', 'renoteUser'); if (user) generateMutedUserQuery(query, user); |