@xuda.io/account_module 1.2.1302 → 1.2.1304
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 +5 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1423,7 +1423,8 @@ export const get_contact_info = async function (uid, contact_doc, _id) {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
if (doc.connection_type === 'account_profile') {
|
|
1425
1425
|
try {
|
|
1426
|
-
const
|
|
1426
|
+
const app_id = await get_account_default_project_id(uid);
|
|
1427
|
+
const account_profile_doc = await db_module.get_app_couch_doc_native(app_id, req_doc.share_item_id);
|
|
1427
1428
|
doc.account_profile = account_profile_doc;
|
|
1428
1429
|
} catch (error) {}
|
|
1429
1430
|
}
|
|
@@ -2803,10 +2804,11 @@ export const get_account_profiles = async function (req) {
|
|
|
2803
2804
|
export const archive_account_profile = async function (req) {
|
|
2804
2805
|
const { uid, profile_id } = req;
|
|
2805
2806
|
try {
|
|
2807
|
+
const app_id = await get_account_default_project_id(uid);
|
|
2806
2808
|
const team_module = await import(`${module_path}/team_module/index.mjs`);
|
|
2807
2809
|
await team_module.validate_share_exist(uid, 'account_profile', profile_id);
|
|
2808
2810
|
|
|
2809
|
-
var account_profile_doc = await db_module.
|
|
2811
|
+
var account_profile_doc = await db_module.get_app_couch_doc_native(app_id, profile_id);
|
|
2810
2812
|
|
|
2811
2813
|
if (account_profile_doc.main) {
|
|
2812
2814
|
throw new Error('reserve');
|
|
@@ -2816,7 +2818,7 @@ export const archive_account_profile = async function (req) {
|
|
|
2816
2818
|
account_profile_doc.stat_ts = Date.now();
|
|
2817
2819
|
account_profile_doc.stat_reason = 'archived by the user';
|
|
2818
2820
|
|
|
2819
|
-
const account_profile_save_ret = await db_module.
|
|
2821
|
+
const account_profile_save_ret = await db_module.save_app_couch_doc(app_id, account_profile_doc);
|
|
2820
2822
|
|
|
2821
2823
|
return account_profile_save_ret;
|
|
2822
2824
|
// } else {
|