mirror of
https://github.com/hexastack/hexabot
synced 2025-05-05 21:34:41 +00:00
fix: rename findAndPopulate method
This commit is contained in:
parent
61d8938212
commit
486def7e75
@ -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,
|
||||
|
@ -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: {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user