From f6e1ee1d408bfad1d8e944fe886c9f59577423c1 Mon Sep 17 00:00:00 2001 From: taichan <40626578+taichanNE30@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:55:15 +0900 Subject: [PATCH] =?UTF-8?q?users/notes=E3=81=A7DB=E3=81=8B=E3=82=89?= =?UTF-8?q?=E5=8F=82=E7=85=A7=E3=81=97=E3=81=9F=E9=9A=9B=E3=81=AB=E3=83=81?= =?UTF-8?q?=E3=83=A3=E3=83=B3=E3=83=8D=E3=83=AB=E6=8A=95=E7=A8=BF=E3=81=AE?= =?UTF-8?q?=E3=81=BF=E5=8F=96=E5=BE=97=E3=81=95=E3=82=8C=E3=82=8B=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(#12056)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(backend): ユーザーのノート取得でDBにfallbackした際にチャンネルノートのみになる * Update CHANGELOG --------- Co-authored-by: syuilo --- CHANGELOG.md | 1 + packages/backend/src/server/api/endpoints/users/notes.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08e9b09a2..b33f0e3df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ ### Server - Enhance: ストリーミングAPIのパフォーマンスを向上 +- Fix: users/notesでDBから参照した際にチャンネル投稿のみ取得される問題を修正 - Fix: コントロールパネルの設定項目が正しく保存できない問題を修正 ## 2023.10.1 diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 4f3d61ce0..2e9eb0dd8 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -151,7 +151,10 @@ export default class extends Endpoint { // eslint- .leftJoinAndSelect('renote.user', 'renoteUser'); if (ps.withChannelNotes) { - if (!isSelf) query.andWhere('channel.isSensitive = false'); + if (!isSelf) query.andWhere(new Brackets(qb => { + qb.orWhere('note.channelId IS NULL'); + qb.orWhere('channel.isSensitive = false'); + })); } else { query.andWhere('note.channelId IS NULL'); }