@xuda.io/account_module 1.2.1140 → 1.2.1142

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 +11 -8
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2572,7 +2572,7 @@ export const get_account_profile_info = async function (uid, contact_profile_doc
2572
2572
 
2573
2573
  const get_pattern = async function (doc) {
2574
2574
  let ret = `default-pattern.png`;
2575
- debugger;
2575
+
2576
2576
  if (doc.shared_from_uid) {
2577
2577
  // const account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', doc.share_item_id);
2578
2578
  const shared_from_uid_ret = await get_account_name({ uid_query: doc.shared_from_uid });
@@ -2785,16 +2785,19 @@ export const unarchive_account_profile = async function (req) {
2785
2785
  var account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
2786
2786
 
2787
2787
  if (account_profile_doc.stat !== 5) {
2788
- throw new Error('contact is not archived');
2788
+ throw new Error('account profile is not archived');
2789
2789
  }
2790
+ if (!account_profile_doc.team_req_id) {
2791
+ account_profile_doc.stat = 3;
2792
+ account_profile_doc.stat_ts = Date.now();
2793
+ account_profile_doc.stat_reason = 'archived by the user';
2790
2794
 
2791
- account_profile_doc.stat = 3;
2792
- account_profile_doc.stat_ts = Date.now();
2793
- account_profile_doc.stat_reason = 'archived by the user';
2794
-
2795
- const account_profile_save_ret = await db_module.save_couch_doc('xuda_accounts', account_profile_doc);
2795
+ const account_profile_save_ret = await db_module.save_couch_doc('xuda_accounts', account_profile_doc);
2796
2796
 
2797
- return account_profile_save_ret;
2797
+ return account_profile_save_ret;
2798
+ } else {
2799
+ return await team_module.change_account_profile_dependencies_status(account_profile_doc.team_req_id, 3);
2800
+ }
2798
2801
  } catch (err) {
2799
2802
  return {
2800
2803
  code: -22,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1140",
3
+ "version": "1.2.1142",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {