From 23e0daed4e9f6f0f5cd17d3ebc828d3f89f30a0c Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Sat, 14 Oct 2023 02:53:52 +0200 Subject: [PATCH] upd: fix getting renote for logged-in user --- packages/backend/src/server/api/endpoints/notes/renotes.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/notes/renotes.ts b/packages/backend/src/server/api/endpoints/notes/renotes.ts index 9f16181a30..2099701ab2 100644 --- a/packages/backend/src/server/api/endpoints/notes/renotes.ts +++ b/packages/backend/src/server/api/endpoints/notes/renotes.ts @@ -40,6 +40,7 @@ export const paramDef = { type: 'object', properties: { noteId: { type: 'string', format: 'misskey:id' }, + userId: { type: "string", format: "misskey:id" }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, @@ -70,6 +71,10 @@ export default class extends Endpoint { // eslint- .leftJoinAndSelect('note.renote', 'renote') .leftJoinAndSelect('reply.user', 'replyUser') .leftJoinAndSelect('renote.user', 'renoteUser'); + + if (ps.userId) { + query.andWhere("user.id = :userId", { userId: ps.userId }); + } this.queryService.generateVisibilityQuery(query, me); if (me) this.queryService.generateMutedUserQuery(query, me);