File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -120,14 +120,13 @@ GET /user/?where=firstName:John
120120 @ApiQuery ({ name: ' where' , required: false , type: ' string' })
121121 @ApiQuery ({ name: ' orderBy' , required: false , type: ' string' })
122122 @UseGuards (AccessGuard )
123- @Serialize (UserEntity )
123+ @Serialize (UserBaseEntity )
124124 @UseAbility (Actions .read , UserEntity )
125125 findAll (
126- @Query (' where' , WherePipe ) where ?: Prisma .UserWhereInput ,
127- @Query (' orderBy' , OrderByPipe )
128- orderBy ?: Prisma .UserOrderByWithRelationInput ,
126+ @Query (' where' , WherePipe ) where ?: Prisma .UserWhereInput ,
127+ @Query (' orderBy' , OrderByPipe ) orderBy ?: Prisma .UserOrderByWithRelationInput ,
129128 ): Promise < PaginatorTypes .PaginatedResult < User >> {
130- return this.userService.findAll(where , orderBy);
129+ return this.userService.findAll(where , orderBy);
131130 }
132131```
133132
@@ -630,5 +629,3 @@ import { loggingMiddleware } from './logging-middleware';
630629})
631630export class AppModule {}
632631```
633-
634- Try out the built in [ Logging Middleware] ( /docs/logging-middleware ) .
Original file line number Diff line number Diff line change @@ -8,19 +8,20 @@ import Serialize from '@decorators/serialize.decorator';
88import { OrderByPipe , WherePipe } from '@nodeteam/nestjs-pipes' ;
99import { Prisma , User } from '@prisma/client' ;
1010import { PaginatorTypes } from '@nodeteam/nestjs-prisma-pagination' ;
11+ import UserBaseEntity from '@modules/user/entities/user-base.entity' ;
1112
12- @ApiTags ( 'User ' )
13+ @ApiTags ( 'Users ' )
1314@ApiBearerAuth ( )
1415@ApiBaseResponses ( )
15- @Controller ( 'user ' )
16+ @Controller ( 'users ' )
1617export class UserController {
1718 constructor ( private readonly userService : UserService ) { }
1819
1920 @Get ( )
2021 @ApiQuery ( { name : 'where' , required : false , type : 'string' } )
2122 @ApiQuery ( { name : 'orderBy' , required : false , type : 'string' } )
2223 @UseGuards ( AccessGuard )
23- @Serialize ( UserEntity )
24+ @Serialize ( UserBaseEntity )
2425 @UseAbility ( Actions . read , UserEntity )
2526 findAll (
2627 @Query ( 'where' , WherePipe ) where ?: Prisma . UserWhereInput ,
You can’t perform that action at this time.
0 commit comments