@xuda.io/account_module 1.2.1286 → 1.2.1288
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 +13 -12
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2100,12 +2100,13 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2100
2100
|
try {
|
|
2101
2101
|
const { uid, email, name, stat, contact_uid, context, source, team_req_id, metadata = {} } = req;
|
|
2102
2102
|
const account_profile_info = await get_active_account_profile_info(uid);
|
|
2103
|
+
const { account_profile_obj } = account_profile_info;
|
|
2103
2104
|
|
|
2104
|
-
const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [account_profile_info.uid, email] });
|
|
2105
|
+
// const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [account_profile_info.uid, email] });
|
|
2105
2106
|
|
|
2106
|
-
if (contact_ret.rows.length) {
|
|
2107
|
-
|
|
2108
|
-
}
|
|
2107
|
+
// if (contact_ret.rows.length) {
|
|
2108
|
+
// throw new Error('contact already exist active or deleted');
|
|
2109
|
+
// }
|
|
2109
2110
|
|
|
2110
2111
|
//////////////////
|
|
2111
2112
|
const opt = {
|
|
@@ -2144,13 +2145,13 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2144
2145
|
} catch (error) {}
|
|
2145
2146
|
}
|
|
2146
2147
|
|
|
2147
|
-
const existing_contacts_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_email_address', { key: email });
|
|
2148
|
-
for (const contact of existing_contacts_ret.rows) {
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
}
|
|
2148
|
+
// const existing_contacts_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_email_address', { key: email });
|
|
2149
|
+
// for (const contact of existing_contacts_ret.rows) {
|
|
2150
|
+
// if (contact.value.profile_avatar) {
|
|
2151
|
+
// profile_avatar = contact.value.profile_avatar;
|
|
2152
|
+
// profile_avatar_obj == contact.value.profile_avatar_obj;
|
|
2153
|
+
// }
|
|
2154
|
+
// }
|
|
2154
2155
|
}
|
|
2155
2156
|
const d = Date.now();
|
|
2156
2157
|
const doc = {
|
|
@@ -2172,7 +2173,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2172
2173
|
is_spam,
|
|
2173
2174
|
profile_avatar,
|
|
2174
2175
|
profile_avatar_obj,
|
|
2175
|
-
|
|
2176
|
+
account_profiles: [account_profile_obj],
|
|
2176
2177
|
};
|
|
2177
2178
|
const ret = await save_contact(uid, doc);
|
|
2178
2179
|
|