diff --git a/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx b/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx index 23c54a12..a0154d7d 100644 --- a/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/access/access-selector/access/crud.tsx @@ -57,7 +57,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat show: false, }, search: { - show: false, + show: true, }, form: { wrapper: { diff --git a/packages/ui/certd-server/src/controller/user/pipeline/access-controller.ts b/packages/ui/certd-server/src/controller/user/pipeline/access-controller.ts index 5be35bab..2aa5b2bd 100644 --- a/packages/ui/certd-server/src/controller/user/pipeline/access-controller.ts +++ b/packages/ui/certd-server/src/controller/user/pipeline/access-controller.ts @@ -23,8 +23,13 @@ export class AccessController extends CrudController { async page(@Body(ALL) body) { body.query = body.query ?? {}; delete body.query.userId; + body.query.userId = this.getUserId() + let name = body.query?.name; + delete body.query.name; const buildQuery = qb => { - qb.andWhere('user_id = :userId', { userId: this.getUserId() }); + if (name) { + qb.andWhere('name like :name', { name: `%${name.trim()}%` }); + } }; const res = await this.service.page({ query: body.query,