11import { Controller , ParseUUIDPipe , Get , UseGuards , Param , Query , Put , Body } from '@nestjs/common' ;
2- import { ApiTags , ApiParam , ApiBearerAuth , ApiQuery } from '@nestjs/swagger' ;
2+ import { ApiTags , ApiParam , ApiBearerAuth , ApiQuery , ApiOkResponse } from '@nestjs/swagger' ;
33import { TestVariationsService } from './test-variations.service' ;
44import { TestVariation , Baseline } from '@prisma/client' ;
55import { JwtAuthGuard } from '../auth/guards/auth.guard' ;
66import { PrismaService } from '../prisma/prisma.service' ;
77import { IgnoreAreaDto } from '../test-runs/dto/ignore-area.dto' ;
88import { CommentDto } from '../shared/dto/comment.dto' ;
9+ import { BuildDto } from 'src/builds/dto/build.dto' ;
910
1011@ApiTags ( 'test-variations' )
1112@Controller ( 'test-variations' )
@@ -16,17 +17,17 @@ export class TestVariationsController {
1617 @ApiQuery ( { name : 'projectId' , required : true } )
1718 @ApiBearerAuth ( )
1819 @UseGuards ( JwtAuthGuard )
19- getList ( @Query ( 'projectId' , new ParseUUIDPipe ( ) ) projectId ) : Promise < TestVariation [ ] > {
20+ getList ( @Query ( 'projectId' , new ParseUUIDPipe ( ) ) projectId : string ) : Promise < TestVariation [ ] > {
2021 return this . prismaService . testVariation . findMany ( {
2122 where : { projectId } ,
2223 } ) ;
2324 }
2425
25- @Get ( ':id' )
26+ @Get ( 'details/ :id' )
2627 @ApiQuery ( { name : 'id' , required : true } )
2728 @ApiBearerAuth ( )
2829 @UseGuards ( JwtAuthGuard )
29- getDetails ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id ) : Promise < TestVariation & { baselines : Baseline [ ] } > {
30+ getDetails ( @Param ( 'id' , new ParseUUIDPipe ( ) ) id : string ) : Promise < TestVariation & { baselines : Baseline [ ] } > {
3031 return this . testVariations . getDetails ( id ) ;
3132 }
3233
@@ -49,15 +50,13 @@ export class TestVariationsController {
4950 return this . testVariations . updateComment ( id , body ) ;
5051 }
5152
52- @Get ( 'merge' )
53+ @Get ( 'merge/ ' )
5354 @ApiQuery ( { name : 'projectId' , required : true } )
5455 @ApiQuery ( { name : 'branchName' , required : true } )
56+ @ApiOkResponse ( { type : BuildDto } )
5557 @ApiBearerAuth ( )
5658 @UseGuards ( JwtAuthGuard )
57- merge (
58- @Query ( 'projectId' , new ParseUUIDPipe ( ) ) projectId : string ,
59- @Query ( 'branchName' ) branchName : string
60- ) : Promise < void > {
59+ merge ( @Query ( 'projectId' ) projectId : string , @Query ( 'branchName' ) branchName : string ) : Promise < BuildDto > {
6160 return this . testVariations . merge ( projectId , branchName ) ;
6261 }
6362}
0 commit comments