@xuda.io/account_module 1.2.1118 → 1.2.1121

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.
Files changed (2) hide show
  1. package/index.mjs +6 -10
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2526,13 +2526,9 @@ setTimeout(async () => {
2526
2526
  console.log(ret);
2527
2527
  }, 1000);
2528
2528
 
2529
- export const get_pending_share_profile_in = async function (uid, _id) {
2529
+ export const get_share_profile_in = async function (uid, pending) {
2530
2530
  let docs = [];
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
- }
2531
+ const from_opt = { selector: { docType: 'team_request', access_type: 'account_profile', team_req_stat: pending ? 2 : 3, team_req_to_uid: uid }, fields: ['_id', 'team_req_date', 'sender_account_info.email', 'team_req_from_uid', 'share_item_id'] };
2536
2532
 
2537
2533
  const requests_from_res = await db_module.find_couch_query('xuda_team', from_opt);
2538
2534
 
@@ -2556,10 +2552,10 @@ export const get_account_profile_info = async function (uid, contact_profile_doc
2556
2552
  doc = await db_module.get_couch_doc_native('xuda_accounts', _id);
2557
2553
  }
2558
2554
  doc.notifications = 0;
2559
- debugger;
2555
+
2560
2556
  let uid_query = uid;
2561
- if (pending) uid_query = shared_from_uid;
2562
- const account_info_ret = await get_account_name({ uid_query: uid });
2557
+ if (doc.pending) uid_query = doc.shared_from_uid;
2558
+ const account_info_ret = await get_account_name({ uid_query });
2563
2559
  if (account_info_ret.code < 0) {
2564
2560
  return;
2565
2561
  }
@@ -2705,7 +2701,7 @@ export const get_account_profiles = async function (req) {
2705
2701
  if (!profile_id) {
2706
2702
  if (filter_type === 'pending') {
2707
2703
  ////// FROM - IN
2708
- shared_from.docs = await get_pending_share_profile_in(uid);
2704
+ shared_from.docs = await get_share_profile_in(uid, true);
2709
2705
  shared_from.total_docs = shared_from.docs.length;
2710
2706
  }
2711
2707
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1118",
3
+ "version": "1.2.1121",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {