@xuda.io/account_module 1.2.1419 → 1.2.1421

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 +13 -12
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2165,15 +2165,17 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2165
2165
 
2166
2166
  let { code: contact_code, data: contact_obj } = await db_module.get_app_couch_doc(account_profile_info.app_id, contact_id);
2167
2167
 
2168
- account_info.profile_picture_obj = file_ret.data;
2168
+ contact_obj.profile_picture_obj = file_ret.data;
2169
2169
 
2170
- account_info.profile_picture = account_info.profile_picture_obj.file_url;
2171
- account_info.profile_picture_source = file_ret.profile_picture_source;
2170
+ contact_obj.profile_picture = contact_obj.profile_picture_obj.file_url;
2171
+ contact_obj.profile_picture_source = file_ret.profile_picture_source;
2172
2172
  const contact_save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_obj);
2173
- profile_picture = account_info.profile_picture;
2173
+ profile_picture = contact_obj.profile_picture;
2174
2174
  }
2175
2175
 
2176
- if (!account_info.profile_avatar) {
2176
+ // get business info
2177
+
2178
+ if (!contact_obj.profile_avatar) {
2177
2179
  let business_size;
2178
2180
 
2179
2181
  switch (account_obj.membership_plan) {
@@ -2208,16 +2210,15 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2208
2210
  break;
2209
2211
  }
2210
2212
 
2211
- const name = account_info.account_type === 'business' ? account_info.business_name : account_info.full_name;
2212
- const { bio, country, mainCategory, subCategory } = account_info;
2213
+ // const name = account_info.account_type === 'business' ? account_info.business_name : account_info.full_name;
2214
+ // const { bio, country, mainCategory, subCategory } = account_info;
2213
2215
 
2214
- const file_ret = await ai_module.get_profile_avatar(profile_picture, uid, '', account_profile_info, account_info.account_type, 'account', account_uid, { bio, country, mainCategory, subCategory }, business_size, name, account_info.email, job_id, headers);
2216
+ const file_ret = await ai_module.get_profile_avatar(profile_picture, uid, '', account_profile_info, contact_obj.account_type, 'contact', contact_id, { bio, country, mainCategory, subCategory }, business_size, contact_obj.name, contact_obj.email, job_id, headers);
2215
2217
 
2216
- let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
2217
- let account_info = account_obj.account_info;
2218
+ let { code: contact_code, data: contact_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
2218
2219
 
2219
- account_info.profile_avatar_obj = file_ret;
2220
- account_info.profile_avatar = account_info.profile_avatar_obj.file_url;
2220
+ contact_obj.profile_avatar_obj = file_ret;
2221
+ contact_obj.profile_avatar = contact_obj.profile_avatar_obj.file_url;
2221
2222
 
2222
2223
  const contact_save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_obj);
2223
2224
  await update_contact_profile_picture_status(uid, contact_id, 3);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1419",
3
+ "version": "1.2.1421",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {