@xuda.io/account_module 1.2.1191 → 1.2.1193
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 +12 -11
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1925,7 +1925,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1925
1925
|
try {
|
|
1926
1926
|
const { uid, email, name, stat, contact_uid, context, source, team_req_id, metadata = {} } = req;
|
|
1927
1927
|
const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [uid, email] });
|
|
1928
|
-
const account_profile_info = await
|
|
1928
|
+
const account_profile_info = await get_active_account_profile_info(uid);
|
|
1929
1929
|
|
|
1930
1930
|
if (contact_ret.rows.length) {
|
|
1931
1931
|
throw new Error('contact already exist active or deleted');
|
|
@@ -1978,6 +1978,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1978
1978
|
is_spam,
|
|
1979
1979
|
profile_avatar,
|
|
1980
1980
|
profile_avatar_obj,
|
|
1981
|
+
account_profile_info,
|
|
1981
1982
|
};
|
|
1982
1983
|
const ret = await db_module.save_couch_doc('xuda_contacts', doc);
|
|
1983
1984
|
|
|
@@ -1986,7 +1987,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1986
1987
|
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
1987
1988
|
if (account_info_ret?.data?.profile_avatar) {
|
|
1988
1989
|
// account_info_ret.data.profile_avatar_stat = 2;
|
|
1989
|
-
ai_module.create_profile_avatar({ url: account_info_ret.data.profile_picture, uid, account_obj: { _id: contact_uid, account_info: account_info_ret.data } }, job_id, headers);
|
|
1990
|
+
ai_module.create_profile_avatar({ url: account_info_ret.data.profile_picture, uid, account_obj: { _id: contact_uid, account_info: account_info_ret.data }, account_profile_info }, job_id, headers);
|
|
1990
1991
|
} else {
|
|
1991
1992
|
if (!doc.profile_avatar) {
|
|
1992
1993
|
// create factual avatar
|
|
@@ -2803,17 +2804,17 @@ export const archive_account_profile = async function (req) {
|
|
|
2803
2804
|
if (account_profile_doc.reserve) {
|
|
2804
2805
|
throw new Error('reserve');
|
|
2805
2806
|
}
|
|
2806
|
-
if (!account_profile_doc.team_req_id) {
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2807
|
+
// if (!account_profile_doc.team_req_id) {
|
|
2808
|
+
account_profile_doc.stat = 5;
|
|
2809
|
+
account_profile_doc.stat_ts = Date.now();
|
|
2810
|
+
account_profile_doc.stat_reason = 'archived by the user';
|
|
2810
2811
|
|
|
2811
|
-
|
|
2812
|
+
const account_profile_save_ret = await db_module.save_couch_doc('xuda_accounts', account_profile_doc);
|
|
2812
2813
|
|
|
2813
|
-
|
|
2814
|
-
} else {
|
|
2815
|
-
|
|
2816
|
-
}
|
|
2814
|
+
return account_profile_save_ret;
|
|
2815
|
+
// } else {
|
|
2816
|
+
// return await team_module.change_account_profile_dependencies_status(account_profile_doc.team_req_id, 5);
|
|
2817
|
+
// }
|
|
2817
2818
|
} catch (err) {
|
|
2818
2819
|
return {
|
|
2819
2820
|
code: -22,
|