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/i | |
| 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/i')
| -rw-r--r-- | src/server/api/endpoints/i/notifications.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index af49549d37..812a4bd1dd 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -87,7 +87,11 @@ export default define(meta, async (ps, user) => { .andWhere(`notification.notifieeId = :meId`, { meId: user.id }) .leftJoinAndSelect('notification.notifier', 'notifier') .leftJoinAndSelect('notification.note', 'note') - .leftJoinAndSelect('note.user', 'user'); + .leftJoinAndSelect('note.user', 'user') + .leftJoinAndSelect('note.reply', 'reply') + .leftJoinAndSelect('note.renote', 'renote') + .leftJoinAndSelect('reply.user', 'replyUser') + .leftJoinAndSelect('renote.user', 'renoteUser'); query.andWhere(`notification.notifierId NOT IN (${ mutingQuery.getQuery() })`); query.setParameters(mutingQuery.getParameters()); |