@xuda.io/account_module 1.2.2223 → 1.2.2225
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/index.mjs +9 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2445,7 +2445,7 @@ export const get_contacts = async function (req, job_id, headers) {
|
|
|
2445
2445
|
}
|
|
2446
2446
|
|
|
2447
2447
|
if (!contact_id && with_requests) {
|
|
2448
|
-
if (filter_type === 'pending') {
|
|
2448
|
+
if (filter_type === 'pending' && account_profile_info.is_main) {
|
|
2449
2449
|
////// TO - OUT
|
|
2450
2450
|
requests_to.docs = await get_pending_contact_out(uid);
|
|
2451
2451
|
requests_to.total_docs = requests_to.docs.length;
|
|
@@ -3376,6 +3376,13 @@ export const save_xuda_cache = async function (uid, docType, key, file, metadata
|
|
|
3376
3376
|
const cache = await get_xuda_cache(uid, docType, key);
|
|
3377
3377
|
if (cache) return;
|
|
3378
3378
|
|
|
3379
|
+
const keyWords = key
|
|
3380
|
+
.trim()
|
|
3381
|
+
.toLowerCase()
|
|
3382
|
+
.split(/\s+/)
|
|
3383
|
+
.filter((w) => w.length > 1)
|
|
3384
|
+
.filter((w, i, arr) => arr.indexOf(w) === i); // deduplicate
|
|
3385
|
+
|
|
3379
3386
|
let doc = {
|
|
3380
3387
|
_id: await _common.xuda_get_uuid('cache'),
|
|
3381
3388
|
key: key.toLowerCase().trim(),
|
|
@@ -3385,6 +3392,7 @@ export const save_xuda_cache = async function (uid, docType, key, file, metadata
|
|
|
3385
3392
|
date_created_ts: Date.now(),
|
|
3386
3393
|
metadata,
|
|
3387
3394
|
hits: 0,
|
|
3395
|
+
keyWords,
|
|
3388
3396
|
};
|
|
3389
3397
|
const save_ret = await db_module.save_couch_doc('xuda_cache', doc);
|
|
3390
3398
|
return save_ret;
|