@xuda.io/account_module 1.2.1127 → 1.2.1129
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 +10 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2526,9 +2526,13 @@ setTimeout(async () => {
|
|
|
2526
2526
|
console.log(ret);
|
|
2527
2527
|
}, 1000);
|
|
2528
2528
|
|
|
2529
|
-
export const
|
|
2529
|
+
export const get_pending_share_profile_in = async function (uid, _id) {
|
|
2530
2530
|
let docs = [];
|
|
2531
|
-
const from_opt = { selector: { docType: 'team_request', access_type: 'account_profile', team_req_stat:
|
|
2531
|
+
const from_opt = { selector: { docType: 'team_request', access_type: 'account_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'] };
|
|
2532
|
+
|
|
2533
|
+
if (_id) {
|
|
2534
|
+
to_opt.selector._id = _id;
|
|
2535
|
+
}
|
|
2532
2536
|
|
|
2533
2537
|
const requests_from_res = await db_module.find_couch_query('xuda_team', from_opt);
|
|
2534
2538
|
|
|
@@ -2536,7 +2540,7 @@ export const get_share_profile_in = async function (uid, pending) {
|
|
|
2536
2540
|
let doc = await db_module.get_couch_doc_native('xuda_accounts', e.share_item_id);
|
|
2537
2541
|
|
|
2538
2542
|
doc.shared_from_uid = e.team_req_from_uid;
|
|
2539
|
-
doc.pending =
|
|
2543
|
+
doc.pending = true;
|
|
2540
2544
|
doc = await get_account_profile_info(uid, doc);
|
|
2541
2545
|
doc.team_req_id = e._id;
|
|
2542
2546
|
|
|
@@ -2630,7 +2634,7 @@ export const get_account_profiles = async function (req) {
|
|
|
2630
2634
|
break;
|
|
2631
2635
|
}
|
|
2632
2636
|
case 'shared': {
|
|
2633
|
-
|
|
2637
|
+
opt.selector.shared_from_uid = { $gt: null };
|
|
2634
2638
|
break;
|
|
2635
2639
|
}
|
|
2636
2640
|
|
|
@@ -2699,9 +2703,9 @@ export const get_account_profiles = async function (req) {
|
|
|
2699
2703
|
}
|
|
2700
2704
|
|
|
2701
2705
|
if (!profile_id) {
|
|
2702
|
-
if (filter_type
|
|
2706
|
+
if (filter_type === 'pending') {
|
|
2703
2707
|
////// FROM - IN
|
|
2704
|
-
shared_from.docs = await
|
|
2708
|
+
shared_from.docs = await get_pending_share_profile_in(uid);
|
|
2705
2709
|
shared_from.total_docs = shared_from.docs.length;
|
|
2706
2710
|
}
|
|
2707
2711
|
}
|