File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/management/identities Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,19 @@ export class IdentitiesController extends AbstractController {
169169 }
170170 }
171171
172+ @Get ( 'count' )
173+ public async count (
174+ @Res ( ) res : Response ,
175+ @SearchFilterSchema ( ) searchFilterSchema : FilterSchema ,
176+ @SearchFilterOptions ( ) searchFilterOptions : FilterOptions ,
177+ ) : Promise < Response < number > > {
178+ const total = await this . _service . count ( searchFilterSchema , searchFilterOptions ) ;
179+ return res . status ( HttpStatus . OK ) . json ( {
180+ statusCode : HttpStatus . OK ,
181+ data : total ,
182+ } ) ;
183+ }
184+
172185 @Patch ( ':_id([0-9a-fA-F]{24})' )
173186 @ApiParam ( { name : '_id' , type : String } )
174187 @ApiUpdateDecorator ( IdentitiesUpdateDto , IdentitiesDto )
@@ -192,7 +205,7 @@ export class IdentitiesController extends AbstractController {
192205 @Body ( ) body : IdentitiesUpdateDto ,
193206 @Res ( ) res : Response ,
194207 ) : Promise < Response > {
195- const identity = await this . _service . findById ( _id ) ;
208+ const identity = await this . _service . findById < Identities > ( _id ) ;
196209 if ( ! identity ) {
197210 throw new BadRequestException ( 'Identity not found' ) ;
198211 }
You can’t perform that action at this time.
0 commit comments