@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/dist/index.mjs
CHANGED
|
@@ -7238,17 +7238,21 @@ function usePSGCRepo() {
|
|
|
7238
7238
|
}
|
|
7239
7239
|
}
|
|
7240
7240
|
async function getByName({ name, prefix = "", type = "" } = {}) {
|
|
7241
|
-
const query = { $text: { $search: name } };
|
|
7242
|
-
const cacheKeyOptions = { name };
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7241
|
+
const query = { $text: { $search: name }, type };
|
|
7242
|
+
const cacheKeyOptions = { name, type };
|
|
7243
|
+
const _types = ["City", "Mun"];
|
|
7244
|
+
if (_types.includes(type)) {
|
|
7245
|
+
query.type = { $in: _types };
|
|
7246
7246
|
}
|
|
7247
7247
|
if (prefix) {
|
|
7248
7248
|
query.code = { $regex: `^${prefix}` };
|
|
7249
7249
|
cacheKeyOptions.prefix = prefix;
|
|
7250
7250
|
}
|
|
7251
7251
|
const cacheKey = makeCacheKey13(namespace_collection, { name });
|
|
7252
|
+
logger19.log({
|
|
7253
|
+
level: "info",
|
|
7254
|
+
message: `Query for getByName PSGC: ${JSON.stringify(query)}`
|
|
7255
|
+
});
|
|
7252
7256
|
try {
|
|
7253
7257
|
const cached = await getCache(cacheKey);
|
|
7254
7258
|
if (cached) {
|