@eeplatform/core 1.8.1 → 1.8.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @eeplatform/core
2
2
 
3
+ ## 1.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 8d80c53: Add logger to PSGC get all function
8
+
9
+ ## 1.8.2
10
+
11
+ ### Patch Changes
12
+
13
+ - a51c5b5: Update PSDGC get all query
14
+
3
15
  ## 1.8.1
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -7216,17 +7216,21 @@ function usePSGCRepo() {
7216
7216
  }
7217
7217
  }
7218
7218
  async function getByName({ name, prefix = "", type = "" } = {}) {
7219
- const query = { $text: { $search: name } };
7220
- const cacheKeyOptions = { name };
7221
- if (["City", "Mun"].includes(type)) {
7222
- query.type = { $in: ["City", "Mun"] };
7223
- cacheKeyOptions.type = type;
7219
+ const query = { $text: { $search: name }, type };
7220
+ const cacheKeyOptions = { name, type };
7221
+ const _types = ["City", "Mun"];
7222
+ if (_types.includes(type)) {
7223
+ query.type = { $in: _types };
7224
7224
  }
7225
7225
  if (prefix) {
7226
7226
  query.code = { $regex: `^${prefix}` };
7227
7227
  cacheKeyOptions.prefix = prefix;
7228
7228
  }
7229
7229
  const cacheKey = (0, import_nodejs_utils39.makeCacheKey)(namespace_collection, { name });
7230
+ import_nodejs_utils39.logger.log({
7231
+ level: "info",
7232
+ message: `Query for getByName PSGC: ${JSON.stringify(query)}`
7233
+ });
7230
7234
  try {
7231
7235
  const cached = await getCache(cacheKey);
7232
7236
  if (cached) {