From ea04778649f24719c40ff40f16438175f62da534 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 25 Feb 2023 18:26:35 +0900 Subject: [PATCH] feat: in-channel featured note Resolve #9938 --- CHANGELOG.md | 1 + .../server/api/endpoints/notes/featured.ts | 3 ++ packages/frontend/src/pages/channel.vue | 36 +++++++++++++------ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d885c47ca0..489fcff2cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ You should also include the user name that made the change. ## 13.x.x (unreleased) ### Improvements +- チャンネル内ハイライト - renoteした際の表示を改善 - バックグラウンドで一定時間経過したらページネーションのアイテム更新をしない - enhance(client): MkUrlPreviewの閉じるボタンを見やすく diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index 26f69373d1..cf939f6631 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -28,6 +28,7 @@ export const paramDef = { properties: { limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, offset: { type: 'integer', default: 0 }, + channelId: { type: 'string', nullable: true, format: 'misskey:id' }, }, required: [], } as const; @@ -63,6 +64,8 @@ export default class extends Endpoint { .leftJoinAndSelect('renoteUser.avatar', 'renoteUserAvatar') .leftJoinAndSelect('renoteUser.banner', 'renoteUserBanner'); + if (ps.channelId) query.andWhere('note.channelId = :channelId', { channelId: ps.channelId }); + if (me) this.queryService.generateMutedUserQuery(query, me); if (me) this.queryService.generateBlockedUserQuery(query, me); diff --git a/packages/frontend/src/pages/channel.vue b/packages/frontend/src/pages/channel.vue index f59b7d7f90..6b4fcb32f8 100644 --- a/packages/frontend/src/pages/channel.vue +++ b/packages/frontend/src/pages/channel.vue @@ -1,9 +1,9 @@