@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 +12 -0
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
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) {
|