diff --git a/api/src/nlp/controllers/nlp-value.controller.ts b/api/src/nlp/controllers/nlp-value.controller.ts index f1e09dad..6c8c0e42 100644 --- a/api/src/nlp/controllers/nlp-value.controller.ts +++ b/api/src/nlp/controllers/nlp-value.controller.ts @@ -126,7 +126,7 @@ export class NlpValueController extends BaseController< } @Get('') - async findAndPopulateNlpValuesWithCount( + async findAndPopulateWithCount( @Query(PageQueryPipe) pageQuery: PageQueryDto, @Query(PopulatePipe) populate: string[], @Query( @@ -134,7 +134,7 @@ export class NlpValueController extends BaseController< ) filters: TFilterQuery, ) { - return await this.nlpValueService.findAndPopulateNlpValuesWithCount( + return await this.nlpValueService.findAndPopulateWithCount( pageQuery, populate, filters, diff --git a/api/src/nlp/repositories/nlp-value.repository.ts b/api/src/nlp/repositories/nlp-value.repository.ts index 8d68a654..54869623 100644 --- a/api/src/nlp/repositories/nlp-value.repository.ts +++ b/api/src/nlp/repositories/nlp-value.repository.ts @@ -108,13 +108,13 @@ export class NlpValueRepository extends BaseRepository< } } - async findAndPopulateNlpValuesWithCount( + async findAndPopulateWithCount( { limit = 10, skip = 0, sort = ['createdAt', -1] }: PageQueryDto, populate: string[], { $and = [], ...rest }: TFilterQuery, ) { return this.model - .aggregate([ + .aggregate([ { // support filters $match: { diff --git a/api/src/nlp/services/nlp-value.service.ts b/api/src/nlp/services/nlp-value.service.ts index 71ccd031..6e5ccc35 100644 --- a/api/src/nlp/services/nlp-value.service.ts +++ b/api/src/nlp/services/nlp-value.service.ts @@ -221,12 +221,12 @@ export class NlpValueService extends BaseService< return Promise.all(promises); } - async findAndPopulateNlpValuesWithCount( + async findAndPopulateWithCount( pageQuery: PageQueryDto, populate: string[], filters: TFilterQuery, ) { - return await this.repository.findAndPopulateNlpValuesWithCount( + return await this.repository.findAndPopulateWithCount( pageQuery, populate, filters,