@xuda.io/account_module 1.2.1418 → 1.2.1420

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 -14
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2160,20 +2160,20 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2160
2160
  throw new Error(`contact ${contact_id} not found`);
2161
2161
  }
2162
2162
  await update_contact_profile_picture_status(uid, contact_id, 2);
2163
- if (!account_info.profile_picture) {
2164
- const file_ret = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata, account_info }, account_profile_info, job_id, headers);
2163
+ if (!contact_obj.profile_picture) {
2164
+ const file_ret = await ai_module.get_profile_picture(uid, contact_obj.account_type, contact_obj.name, { email: contact_obj.email, metadata }, account_profile_info, job_id, headers);
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
+ if (!contact_obj.profile_avatar) {
2177
2177
  let business_size;
2178
2178
 
2179
2179
  switch (account_obj.membership_plan) {
@@ -2208,16 +2208,15 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2208
2208
  break;
2209
2209
  }
2210
2210
 
2211
- const name = account_info.account_type === 'business' ? account_info.business_name : account_info.full_name;
2212
- const { bio, country, mainCategory, subCategory } = account_info;
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
2213
 
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);
2214
+ 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
2215
 
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;
2216
+ let { code: contact_code, data: contact_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
2218
2217
 
2219
- account_info.profile_avatar_obj = file_ret;
2220
- account_info.profile_avatar = account_info.profile_avatar_obj.file_url;
2218
+ contact_obj.profile_avatar_obj = file_ret;
2219
+ contact_obj.profile_avatar = contact_obj.profile_avatar_obj.file_url;
2221
2220
 
2222
2221
  const contact_save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_obj);
2223
2222
  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.1418",
3
+ "version": "1.2.1420",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {