From c492d450e9242c082704414d0dd9fee16acb838a Mon Sep 17 00:00:00 2001 From: nenohi Date: Fri, 30 Jun 2023 06:35:20 +0900 Subject: [PATCH] =?UTF-8?q?admin/role/user=E3=81=A7userid=E3=81=8C?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=20(#90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * admin/role/userでuseridが指定できるように * Update packages/backend/src/server/api/endpoints/admin/roles/users.ts --------- Co-authored-by: riku6460 <17585784+riku6460@users.noreply.github.com> --- .../backend/src/server/api/endpoints/admin/roles/users.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/admin/roles/users.ts b/packages/backend/src/server/api/endpoints/admin/roles/users.ts index 35edca5460..328c0bb91b 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/users.ts @@ -28,6 +28,7 @@ export const paramDef = { roleId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, + userId: { type: 'string', format: 'misskey:id' }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, }, required: ['roleId'], @@ -63,6 +64,10 @@ export default class extends Endpoint { })) .innerJoinAndSelect('assign.user', 'user'); + if (ps.userId != null) { + query.andWhere('assign.userId = :userId', { userId: ps.userId }); + } + const assigns = await query .take(ps.limit) .getMany();