@xuda.io/account_module 1.2.1702 → 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.
Files changed (2) hide show
  1. package/index.mjs +16 -10
  2. 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,16 +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.mainCategory = cached_contact.mainCategory;
2160
- contact_obj.subCategory = cached_contact.subCategory;
2161
- contact_obj.business_size = cached_contact.business_size;
2162
- contact_obj.country = cached_contact.country;
2163
- contact_obj.bio = cached_contact.bio;
2164
- contact_obj.business_name = cached_contact.business_name;
2165
- // contact_obj.is_spam = cached_contact.is_spam;
2166
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
+ // }
2167
2173
  const save_ret = await save_contact(uid, contact_obj);
2168
2174
  save_xuda_cache(uid, 'contact', contact_obj.email, null, contact_obj);
2169
2175
  if (!contact_obj.is_spam && contact_obj.name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1702",
3
+ "version": "1.2.1704",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {