@xuda.io/account_module 1.2.1141 → 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.
- package/index.mjs +10 -7
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -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('
|
|
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
|
-
|
|
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
|
-
|
|
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,
|