mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-05 10:18:09 +09:00
admin/role/userでuseridが指定できるように (#90)
* 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>
This commit is contained in:
parent
91af2d7b06
commit
c492d450e9
@ -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<typeof meta, typeof paramDef> {
|
||||
}))
|
||||
.innerJoinAndSelect('assign.user', 'user');
|
||||
|
||||
if (ps.userId != null) {
|
||||
query.andWhere('assign.userId = :userId', { userId: ps.userId });
|
||||
}
|
||||
|
||||
const assigns = await query
|
||||
.take(ps.limit)
|
||||
.getMany();
|
||||
|
Loading…
Reference in New Issue
Block a user