diff --git a/packages/ui/certd-server/src/controller/cname/cname-provider-controller.ts b/packages/ui/certd-server/src/controller/cname/cname-provider-controller.ts index 958c40df4..919f0fc0d 100644 --- a/packages/ui/certd-server/src/controller/cname/cname-provider-controller.ts +++ b/packages/ui/certd-server/src/controller/cname/cname-provider-controller.ts @@ -20,7 +20,8 @@ export class CnameProviderController extends BaseController { @Post('/list', { summary: Constants.per.authOnly }) async list(@Body(ALL) body: any) { - body.userId = this.getUserId(); + body.query = body.query ?? {}; + body.query.userId = this.getUserId(); const res = await this.providerService.list({}); return this.ok(res); } diff --git a/packages/ui/certd-server/src/controller/cname/cname-record-controller.ts b/packages/ui/certd-server/src/controller/cname/cname-record-controller.ts index ecec8ee1b..db6982201 100644 --- a/packages/ui/certd-server/src/controller/cname/cname-record-controller.ts +++ b/packages/ui/certd-server/src/controller/cname/cname-record-controller.ts @@ -39,7 +39,8 @@ export class CnameRecordController extends CrudController { @Post('/list', { summary: Constants.per.authOnly }) async list(@Body(ALL) body: any) { - body.userId = this.getUserId(); + body.query = body.query ?? {}; + body.query.userId = this.getUserId(); const list = await this.getService().list(body); return this.ok(list); } diff --git a/packages/ui/certd-server/src/controller/mine/user-settings-controller.ts b/packages/ui/certd-server/src/controller/mine/user-settings-controller.ts index 4fa9e9510..982d4d4af 100644 --- a/packages/ui/certd-server/src/controller/mine/user-settings-controller.ts +++ b/packages/ui/certd-server/src/controller/mine/user-settings-controller.ts @@ -25,7 +25,8 @@ export class UserSettingsController extends CrudController @Post('/list', { summary: Constants.per.authOnly }) async list(@Body(ALL) body) { - body.userId = this.getUserId(); + body.query = body.query ?? {}; + body.query.userId = this.getUserId(); return super.list(body); } diff --git a/packages/ui/certd-server/src/controller/pipeline/access-controller.ts b/packages/ui/certd-server/src/controller/pipeline/access-controller.ts index b964af88f..8abbb536f 100644 --- a/packages/ui/certd-server/src/controller/pipeline/access-controller.ts +++ b/packages/ui/certd-server/src/controller/pipeline/access-controller.ts @@ -37,7 +37,8 @@ export class AccessController extends CrudController { @Post('/list', { summary: Constants.per.authOnly }) async list(@Body(ALL) body) { - body.userId = this.getUserId(); + body.query = body.query ?? {}; + body.query.userId = this.getUserId(); return super.list(body); } diff --git a/packages/ui/certd-server/src/controller/pipeline/history-controller.ts b/packages/ui/certd-server/src/controller/pipeline/history-controller.ts index c2393a8e3..85ec17822 100644 --- a/packages/ui/certd-server/src/controller/pipeline/history-controller.ts +++ b/packages/ui/certd-server/src/controller/pipeline/history-controller.ts @@ -78,9 +78,10 @@ export class HistoryController extends CrudController { @Post('/list', { summary: Constants.per.authOnly }) async list(@Body(ALL) body) { + body.query = body.query ?? {}; const isAdmin = await this.authService.isAdmin(this.ctx); if (!isAdmin) { - body.userId = this.getUserId(); + body.query.userId = this.getUserId(); } if (body.pipelineId == null) { return this.ok([]); diff --git a/packages/ui/certd-server/src/controller/pipeline/notification-controller.ts b/packages/ui/certd-server/src/controller/pipeline/notification-controller.ts index 18db5c493..77dba97ee 100644 --- a/packages/ui/certd-server/src/controller/pipeline/notification-controller.ts +++ b/packages/ui/certd-server/src/controller/pipeline/notification-controller.ts @@ -38,7 +38,8 @@ export class NotificationController extends CrudController @Post('/list', { summary: Constants.per.authOnly }) async list(@Body(ALL) body) { - body.userId = this.getUserId(); + body.query = body.query ?? {}; + body.query.userId = this.getUserId(); return super.list(body); } diff --git a/packages/ui/certd-server/src/controller/pipeline/pipeline-group-controller.ts b/packages/ui/certd-server/src/controller/pipeline/pipeline-group-controller.ts index ec3ffc0fd..c26cf77ee 100644 --- a/packages/ui/certd-server/src/controller/pipeline/pipeline-group-controller.ts +++ b/packages/ui/certd-server/src/controller/pipeline/pipeline-group-controller.ts @@ -36,7 +36,8 @@ export class PipelineGroupController extends CrudController { @Post('/page', { summary: 'sys:settings:view' }) async page(@Body(ALL) body) { - body.query = body.query ?? {}; - body.query.userId = this.getUserId(); return super.page(body); } @Post('/list', { summary: 'sys:settings:view' }) async list(@Body(ALL) body) { - body.userId = this.getUserId(); return super.list(body); } @Post('/add', { summary: 'sys:settings:edit' }) async add(@Body(ALL) bean) { - bean.userId = this.getUserId(); return super.add(bean); }