@xuda.io/account_module 1.2.1411 → 1.2.1413

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 +9 -7
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2075,9 +2075,12 @@ const set_account_profile_picture = async function (uid, account_uid) {
2075
2075
  if (account_code < 0) {
2076
2076
  throw new Error(`account ${account_uid} not found`);
2077
2077
  }
2078
+
2079
+ const name = account_info.account_type === 'business' ? account_info.business_name : account_info.full_name;
2080
+
2078
2081
  await update_account_profile_picture_status(account_uid, 2);
2079
2082
  if (!account_info.profile_picture) {
2080
- const file_ret = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata, account_info }, account_profile_info, job_id, headers);
2083
+ const file_ret = await ai_module.get_profile_picture(uid, account_info.account_type, name, { email, context, metadata, account_info }, account_profile_info, job_id, headers);
2081
2084
 
2082
2085
  let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
2083
2086
  let account_info = account_obj.account_info;
@@ -2125,7 +2128,6 @@ const set_account_profile_picture = async function (uid, account_uid) {
2125
2128
  break;
2126
2129
  }
2127
2130
 
2128
- const name = account_info.account_type === 'business' ? account_info.business_name : account_info.full_name;
2129
2131
  const { bio, country, mainCategory, subCategory } = account_info;
2130
2132
 
2131
2133
  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);
@@ -2147,16 +2149,16 @@ const set_account_profile_picture = async function (uid, account_uid) {
2147
2149
  const set_contact_profile_picture = async function (uid, contact_id) {
2148
2150
  const account_profile_info = await get_active_account_profile_info(uid);
2149
2151
 
2150
- await update_contact_profile_picture_status(uid, account_uid, 1);
2152
+ await update_contact_profile_picture_status(uid, contact_id, 1);
2151
2153
  try {
2152
2154
  let profile_picture;
2153
2155
 
2154
2156
  let { code: contact_code, data: contact_obj } = await db_module.get_app_couch_doc(account_profile_info.app_id, contact_id);
2155
2157
 
2156
2158
  if (contact_code < 0) {
2157
- throw new Error(`account ${account_uid} not found`);
2159
+ throw new Error(`contact ${contact_id} not found`);
2158
2160
  }
2159
- await update_contact_profile_picture_status(uid, account_uid, 2);
2161
+ await update_contact_profile_picture_status(uid, contact_id, 2);
2160
2162
  if (!account_info.profile_picture) {
2161
2163
  const file_ret = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata, account_info }, account_profile_info, job_id, headers);
2162
2164
 
@@ -2217,10 +2219,10 @@ const set_contact_profile_picture = async function (uid, contact_id) {
2217
2219
  account_info.profile_avatar = account_info.profile_avatar_obj.file_url;
2218
2220
 
2219
2221
  const contact_save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_obj);
2220
- await update_contact_profile_picture_status(uid, account_uid, 3);
2222
+ await update_contact_profile_picture_status(uid, contact_id, 3);
2221
2223
  }
2222
2224
  } catch (error) {
2223
- await update_contact_profile_picture_status(uid, account_uid, 3);
2225
+ await update_contact_profile_picture_status(uid, contact_id, 3);
2224
2226
  }
2225
2227
  };
2226
2228
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1411",
3
+ "version": "1.2.1413",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {