1
- import { Body , Controller , Delete , Get , HttpStatus , Param , Post , Put , Query } from '@nestjs/common' ;
1
+ import { Body , Controller , Delete , Get , HttpStatus , Param , ParseUUIDPipe , Post , Put , Query } from '@nestjs/common' ;
2
2
import { CrudController } from '../../core' ;
3
3
import { ApiExcludeEndpoint , ApiOAuth2Auth , ApiOperation , ApiResponse , ApiUseTags } from '@nestjs/swagger' ;
4
4
import { Notification } from './notification.entity' ;
@@ -11,7 +11,6 @@ import { NotificationList } from './dto/notification-list.model';
11
11
import { FindNotificationsDto } from './dto/find-notifications.dto' ;
12
12
import { FindOwnNotificationsDto } from './dto/find-own-notifications.dto' ;
13
13
import { User } from '@ngx-starter-kit/models' ;
14
- import { UUIDValidationPipe } from '../../shared' ;
15
14
16
15
@ApiOAuth2Auth ( [ 'read' ] )
17
16
@ApiUseTags ( 'Notifications' )
@@ -34,7 +33,7 @@ export class NotificationController extends CrudController<Notification> {
34
33
return this . notificationService . findAll ( filter ) ;
35
34
}
36
35
37
- @ApiOperation ( { title : "find user's and global Notifications" } )
36
+ @ApiOperation ( { title : "find user's and global Notifications" } ) // tslint:disable-line
38
37
@ApiResponse ( { status : HttpStatus . OK , description : 'Find matching Notifications' , type : NotificationList } )
39
38
@ApiResponse ( { status : HttpStatus . NOT_FOUND , description : 'No matching records found' } )
40
39
@Get ( 'own' )
@@ -49,7 +48,7 @@ export class NotificationController extends CrudController<Notification> {
49
48
@ApiUseTags ( 'Admin' )
50
49
@Roles ( RolesEnum . ADMIN )
51
50
@Get ( ':id' )
52
- async findById ( @Param ( 'id' , UUIDValidationPipe ) id : string ) : Promise < Notification > {
51
+ async findById ( @Param ( 'id' , new ParseUUIDPipe ( { version : '4' } ) ) id : string ) : Promise < Notification > {
53
52
return super . findById ( id ) ;
54
53
}
55
54
0 commit comments