@xuda.io/account_module 1.2.1703 → 1.2.1704
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 +16 -11
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2126,7 +2126,9 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2126
2126
|
account_profiles: [account_profile_obj._id],
|
|
2127
2127
|
account_type: cached_contact?.account_type || account_type,
|
|
2128
2128
|
};
|
|
2129
|
-
if (_.isEmpty(cached_contact)) {
|
|
2129
|
+
if (!_.isEmpty(cached_contact?.business_info)) {
|
|
2130
|
+
contact_obj.business_info = _.cloneDeep(cached_contact.business_info);
|
|
2131
|
+
} else {
|
|
2130
2132
|
if (account_type === 'business' && !is_spam) {
|
|
2131
2133
|
contact_obj.business_info = await ai_module.get_business_info(uid, contact_obj.name, contact_obj.email, account_profile_info);
|
|
2132
2134
|
// const business_info = await ai_module.get_business_info(uid, contact_obj.name, contact_obj.email, account_profile_info);
|
|
@@ -2154,17 +2156,20 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2154
2156
|
contact_obj.name = await ai_module.get_name_from_email_addr(uid, contact_obj.email, account_profile_info);
|
|
2155
2157
|
}
|
|
2156
2158
|
}
|
|
2157
|
-
} else {
|
|
2158
|
-
// get from cache
|
|
2159
|
-
contact_obj.business_info = _.cloneDeep(cached_contact.business_info);
|
|
2160
|
-
// contact_obj.mainCategory = cached_contact.mainCategory;
|
|
2161
|
-
// contact_obj.subCategory = cached_contact.subCategory;
|
|
2162
|
-
// contact_obj.business_size = cached_contact.business_size;
|
|
2163
|
-
// contact_obj.country = cached_contact.country;
|
|
2164
|
-
// contact_obj.bio = cached_contact.bio;
|
|
2165
|
-
// contact_obj.business_name = cached_contact.business_name;
|
|
2166
|
-
// // contact_obj.is_spam = cached_contact.is_spam;
|
|
2167
2159
|
}
|
|
2160
|
+
// else {
|
|
2161
|
+
// // get from cache
|
|
2162
|
+
|
|
2163
|
+
// contact_obj.business_info = _.cloneDeep(cached_contact.business_info);
|
|
2164
|
+
|
|
2165
|
+
// // contact_obj.mainCategory = cached_contact.mainCategory;
|
|
2166
|
+
// // contact_obj.subCategory = cached_contact.subCategory;
|
|
2167
|
+
// // contact_obj.business_size = cached_contact.business_size;
|
|
2168
|
+
// // contact_obj.country = cached_contact.country;
|
|
2169
|
+
// // contact_obj.bio = cached_contact.bio;
|
|
2170
|
+
// // contact_obj.business_name = cached_contact.business_name;
|
|
2171
|
+
// // // contact_obj.is_spam = cached_contact.is_spam;
|
|
2172
|
+
// }
|
|
2168
2173
|
const save_ret = await save_contact(uid, contact_obj);
|
|
2169
2174
|
save_xuda_cache(uid, 'contact', contact_obj.email, null, contact_obj);
|
|
2170
2175
|
if (!contact_obj.is_spam && contact_obj.name) {
|