fix: rename findAndPopulate method

This commit is contained in:
yassinedorbozgithub 2025-03-23 15:14:13 +01:00
parent 61d8938212
commit 486def7e75
3 changed files with 6 additions and 6 deletions

View File

@ -126,7 +126,7 @@ export class NlpValueController extends BaseController<
}
@Get('')
async findAndPopulateNlpValuesWithCount(
async findAndPopulateWithCount(
@Query(PageQueryPipe) pageQuery: PageQueryDto<NlpValue>,
@Query(PopulatePipe) populate: string[],
@Query(
@ -134,7 +134,7 @@ export class NlpValueController extends BaseController<
)
filters: TFilterQuery<NlpValue>,
) {
return await this.nlpValueService.findAndPopulateNlpValuesWithCount(
return await this.nlpValueService.findAndPopulateWithCount(
pageQuery,
populate,
filters,

View File

@ -108,13 +108,13 @@ export class NlpValueRepository extends BaseRepository<
}
}
async findAndPopulateNlpValuesWithCount(
async findAndPopulateWithCount(
{ limit = 10, skip = 0, sort = ['createdAt', -1] }: PageQueryDto<NlpValue>,
populate: string[],
{ $and = [], ...rest }: TFilterQuery<NlpValue>,
) {
return this.model
.aggregate<NlpValue>([
.aggregate([
{
// support filters
$match: {

View File

@ -221,12 +221,12 @@ export class NlpValueService extends BaseService<
return Promise.all(promises);
}
async findAndPopulateNlpValuesWithCount(
async findAndPopulateWithCount(
pageQuery: PageQueryDto<NlpValue>,
populate: string[],
filters: TFilterQuery<NlpValue>,
) {
return await this.repository.findAndPopulateNlpValuesWithCount(
return await this.repository.findAndPopulateWithCount(
pageQuery,
populate,
filters,