@mondart/nestjs-common-module 1.1.30 → 1.1.32

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.
@@ -80,8 +80,8 @@ class CoreCrudService {
80
80
  }
81
81
  else {
82
82
  result = await this.repository.findOne({
83
+ relations: options?.relations ? options?.relations : this.relationsPath,
83
84
  ...query,
84
- relations: query?.relations ? query?.relations : this.relationsPath,
85
85
  });
86
86
  }
87
87
  if (options?.existsCheck && !result) {
@@ -94,14 +94,14 @@ class CoreCrudService {
94
94
  query.where = this.whereQueryTransformer(query.where) ?? undefined;
95
95
  if (options?.entityManager) {
96
96
  result = await options?.entityManager.exists(this.repository.target, {
97
- relations: query?.relations ? query?.relations : this.relationsPath,
97
+ relations: options?.relations ? options?.relations : this.relationsPath,
98
98
  ...query,
99
99
  });
100
100
  }
101
101
  else {
102
102
  result = await this.repository.exists({
103
+ relations: options?.relations ? options?.relations : this.relationsPath,
103
104
  ...query,
104
- relations: query?.relations ? query?.relations : this.relationsPath,
105
105
  });
106
106
  }
107
107
  return result;
@@ -111,14 +111,14 @@ class CoreCrudService {
111
111
  query.where = this.whereQueryTransformer(query.where) ?? undefined;
112
112
  if (options?.entityManager) {
113
113
  result = await options?.entityManager.count(this.repository.target, {
114
- relations: query?.relations ? query?.relations : this.relationsPath,
114
+ relations: options?.relations ? options?.relations : this.relationsPath,
115
115
  ...query,
116
116
  });
117
117
  }
118
118
  else {
119
119
  result = await this.repository.count({
120
+ relations: options?.relations ? options?.relations : this.relationsPath,
120
121
  ...query,
121
- relations: query?.relations ? query?.relations : this.relationsPath,
122
122
  });
123
123
  }
124
124
  return result;