66 HttpStatus ,
77 Inject ,
88 Injectable ,
9- Param ,
109 Post ,
1110 Query ,
1211 UseGuards ,
@@ -101,7 +100,7 @@ export class TableSchemaController {
101100 @Post ( '/table-schema/change/:changeId/approve' )
102101 @HttpCode ( HttpStatus . OK )
103102 async approve (
104- @Param ( 'changeId' ) changeId : string ,
103+ @SlugUuid ( 'changeId' ) changeId : string ,
105104 @UserId ( ) userId : string ,
106105 @MasterPassword ( ) masterPassword : string ,
107106 @Body ( ) body : ApproveSchemaChangeDto ,
@@ -121,7 +120,7 @@ export class TableSchemaController {
121120 @UseGuards ( SchemaChangeOwnershipGuard )
122121 @Post ( '/table-schema/change/:changeId/reject' )
123122 @HttpCode ( HttpStatus . OK )
124- async reject ( @Param ( 'changeId' ) changeId : string , @UserId ( ) userId : string ) : Promise < SchemaChangeResponseDto > {
123+ async reject ( @SlugUuid ( 'changeId' ) changeId : string , @UserId ( ) userId : string ) : Promise < SchemaChangeResponseDto > {
125124 return await this . rejectSchemaChangeUseCase . execute ( { changeId, userId } ) ;
126125 }
127126
@@ -132,7 +131,7 @@ export class TableSchemaController {
132131 @Post ( '/table-schema/change/:changeId/rollback' )
133132 @HttpCode ( HttpStatus . OK )
134133 async rollback (
135- @Param ( 'changeId' ) changeId : string ,
134+ @SlugUuid ( 'changeId' ) changeId : string ,
136135 @UserId ( ) userId : string ,
137136 @MasterPassword ( ) masterPassword : string ,
138137 ) : Promise < SchemaChangeResponseDto > {
@@ -162,7 +161,7 @@ export class TableSchemaController {
162161 @ApiResponse ( { status : 200 , type : SchemaChangeResponseDto } )
163162 @UseGuards ( SchemaChangeOwnershipGuard )
164163 @Get ( '/table-schema/change/:changeId' )
165- async get ( @Param ( 'changeId' ) changeId : string , @UserId ( ) userId : string ) : Promise < SchemaChangeResponseDto > {
164+ async get ( @SlugUuid ( 'changeId' ) changeId : string , @UserId ( ) userId : string ) : Promise < SchemaChangeResponseDto > {
166165 return await this . getSchemaChangeUseCase . execute ( { changeId, userId } ) ;
167166 }
168167
@@ -177,7 +176,7 @@ export class TableSchemaController {
177176 @Post ( '/table-schema/batch/:batchId/approve' )
178177 @HttpCode ( HttpStatus . OK )
179178 async approveBatch (
180- @Param ( 'batchId' ) batchId : string ,
179+ @SlugUuid ( 'batchId' ) batchId : string ,
181180 @UserId ( ) userId : string ,
182181 @MasterPassword ( ) masterPassword : string ,
183182 @Body ( ) body : ApproveBatchSchemaChangeDto ,
@@ -197,7 +196,7 @@ export class TableSchemaController {
197196 @Post ( '/table-schema/batch/:batchId/reject' )
198197 @HttpCode ( HttpStatus . OK )
199198 async rejectBatch (
200- @Param ( 'batchId' ) batchId : string ,
199+ @SlugUuid ( 'batchId' ) batchId : string ,
201200 @UserId ( ) userId : string ,
202201 ) : Promise < SchemaChangeBatchResponseDto > {
203202 return await this . rejectBatchSchemaChangeUseCase . execute ( { batchId, userId } ) ;
@@ -210,7 +209,7 @@ export class TableSchemaController {
210209 @Post ( '/table-schema/batch/:batchId/rollback' )
211210 @HttpCode ( HttpStatus . OK )
212211 async rollbackBatch (
213- @Param ( 'batchId' ) batchId : string ,
212+ @SlugUuid ( 'batchId' ) batchId : string ,
214213 @UserId ( ) userId : string ,
215214 @MasterPassword ( ) masterPassword : string ,
216215 ) : Promise < SchemaChangeBatchResponseDto > {
@@ -222,7 +221,10 @@ export class TableSchemaController {
222221 @ApiResponse ( { status : 200 , type : SchemaChangeBatchResponseDto } )
223222 @UseGuards ( SchemaChangeBatchOwnershipGuard )
224223 @Get ( '/table-schema/batch/:batchId' )
225- async getBatch ( @Param ( 'batchId' ) batchId : string , @UserId ( ) userId : string ) : Promise < SchemaChangeBatchResponseDto > {
224+ async getBatch (
225+ @SlugUuid ( 'batchId' ) batchId : string ,
226+ @UserId ( ) userId : string ,
227+ ) : Promise < SchemaChangeBatchResponseDto > {
226228 return await this . getBatchSchemaChangeUseCase . execute ( { batchId, userId } ) ;
227229 }
228230}
0 commit comments