@xuda.io/account_module 1.2.1069 → 1.2.1071
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 +24 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2483,6 +2483,29 @@ setTimeout(async () => {
|
|
|
2483
2483
|
console.log(ret);
|
|
2484
2484
|
}, 1000);
|
|
2485
2485
|
|
|
2486
|
+
export const get_pending_share_profile_in = async function (uid, _id) {
|
|
2487
|
+
let docs = [];
|
|
2488
|
+
const from_opt = { selector: { docType: 'team_request', access_type: 'profile', team_req_stat: 2, team_req_to_uid: uid }, fields: ['_id', 'team_req_date', 'sender_account_info.email', 'team_req_from_uid', 'share_item_id'] };
|
|
2489
|
+
|
|
2490
|
+
if (_id) {
|
|
2491
|
+
to_opt.selector._id = _id;
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
const requests_from_res = await db_module.find_couch_query('xuda_team', from_opt);
|
|
2495
|
+
|
|
2496
|
+
for await (let e of requests_from_res.docs) {
|
|
2497
|
+
let doc = await db_module.get_couch_doc_native('xuda_accounts', e.share_item_id);
|
|
2498
|
+
|
|
2499
|
+
doc.shared_from_uid = e.team_req_from_uid;
|
|
2500
|
+
doc.pending = true;
|
|
2501
|
+
doc = await get_account_profile_info(uid, doc);
|
|
2502
|
+
doc.team_req_id = e._id;
|
|
2503
|
+
|
|
2504
|
+
docs.push(doc);
|
|
2505
|
+
}
|
|
2506
|
+
return docs;
|
|
2507
|
+
};
|
|
2508
|
+
|
|
2486
2509
|
export const get_account_profile_info = async function (uid, contact_profile_doc, _id) {
|
|
2487
2510
|
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
2488
2511
|
let doc = contact_profile_doc;
|
|
@@ -2657,7 +2680,7 @@ export const get_account_profiles = async function (req) {
|
|
|
2657
2680
|
|
|
2658
2681
|
let profile_docs = { docs: [], total_docs: profiles.total_docs };
|
|
2659
2682
|
for await (let doc of profiles.docs) {
|
|
2660
|
-
doc = await
|
|
2683
|
+
doc = await get_account_profile_info(uid, doc);
|
|
2661
2684
|
|
|
2662
2685
|
profile_docs.docs.push(doc);
|
|
2663
2686
|
}
|