From 0ee8c474bbfe6108c539bf8ef7757a9c68a5a565 Mon Sep 17 00:00:00 2001 From: KieSun Date: Mon, 27 Nov 2023 15:17:45 +0800 Subject: [PATCH] feat: geContributionList add owner id --- src/core/service/contribution.service.ts | 3 ++- src/core/type/doc/contribution.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/service/contribution.service.ts b/src/core/service/contribution.service.ts index 9709fb8..589137b 100644 --- a/src/core/service/contribution.service.ts +++ b/src/core/service/contribution.service.ts @@ -19,13 +19,14 @@ export class ContributionService { constructor(private prisma: PrismaService, private easService: EasService) {} async getContributionList(query: ContributionListQuery) { - const { projectId, currentPage, pageSize } = query; + const { projectId, currentPage, pageSize, ownerId = '' } = query; return paginate( this.prisma.contribution, { where: { deleted: false, projectId, + ownerId, }, }, { diff --git a/src/core/type/doc/contribution.ts b/src/core/type/doc/contribution.ts index 1a3fcfa..8857141 100644 --- a/src/core/type/doc/contribution.ts +++ b/src/core/type/doc/contribution.ts @@ -15,6 +15,11 @@ export class ContributionListQuery extends PaginateQuery { @IsString() @ApiProperty({ type: 'string' }) projectId: string; + + @IsNotEmpty() + @IsString() + @ApiProperty({ type: 'string' }) + ownerId: string; } export class UpdateContributionStateBody extends AuthBody {