@punks/backend-entity-manager 0.0.318 → 0.0.320

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -3298,29 +3298,14 @@ class TypeOrmQueryBuilder extends QueryBuilderBase {
3298
3298
  return acc;
3299
3299
  }, {});
3300
3300
  }
3301
- async calculateStringFieldFacets({ field, request, context, relations, }) {
3302
- return await this.calculateFacet({
3303
- field,
3304
- request,
3305
- context,
3306
- relations,
3307
- });
3301
+ async calculateStringFieldFacets(input) {
3302
+ return await this.calculateFacet(input);
3308
3303
  }
3309
- async calculateNumericFieldFacets({ field, request, context, relations, }) {
3310
- return await this.calculateFacet({
3311
- field,
3312
- request,
3313
- context,
3314
- relations,
3315
- });
3304
+ async calculateNumericFieldFacets(input) {
3305
+ return await this.calculateFacet(input);
3316
3306
  }
3317
- async calculateBooleanFieldFacets(field, request, context, relations) {
3318
- return await this.calculateFacet({
3319
- field,
3320
- request,
3321
- context,
3322
- relations,
3323
- });
3307
+ async calculateBooleanFieldFacets(input) {
3308
+ return await this.calculateFacet(input);
3324
3309
  }
3325
3310
  async calculateFacet({ field, request, context, relations, labelSelector, }) {
3326
3311
  let query = this.getRepository()
@@ -3338,7 +3323,7 @@ class TypeOrmQueryBuilder extends QueryBuilderBase {
3338
3323
  if (labelSelector) {
3339
3324
  query.addSelect(labelSelector, "label").addGroupBy(labelSelector);
3340
3325
  }
3341
- const results = await query.orderBy(fieldName).getRawMany();
3326
+ const results = await query.orderBy(labelSelector ?? fieldName).getRawMany();
3342
3327
  return {
3343
3328
  values: results.map((x) => ({
3344
3329
  value: x.value,