@xuda.io/account_module 1.2.1400 → 1.2.1402

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 +10 -9
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2065,21 +2065,22 @@ export const add_contact = async function (req, job_id, headers) {
2065
2065
  }
2066
2066
  };
2067
2067
 
2068
- const set_account_profile_picture = async function (uid, contact_uid) {
2068
+ const set_account_profile_picture = async function (uid, account_uid) {
2069
+ await update_profile_avatar_status(account_uid, 1);
2069
2070
  try {
2070
2071
  let profile_picture;
2071
2072
 
2072
- let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', contact_uid);
2073
+ let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
2073
2074
  let account_info = account_obj.account_info;
2074
2075
 
2075
2076
  if (account_code < 0) {
2076
- throw new Error(`account ${contact_uid} not found`);
2077
+ throw new Error(`account ${account_uid} not found`);
2077
2078
  }
2078
- await update_profile_avatar_status(contact_uid, 2);
2079
+ await update_profile_avatar_status(account_uid, 2);
2079
2080
  if (!account_info.profile_picture) {
2080
2081
  const file_ret = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata, account_info }, account_profile_info, job_id, headers);
2081
2082
 
2082
- let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', contact_uid);
2083
+ let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
2083
2084
  let account_info = account_obj.account_info;
2084
2085
 
2085
2086
  account_info.profile_picture_obj = file_ret.data;
@@ -2127,19 +2128,19 @@ const set_account_profile_picture = async function (uid, contact_uid) {
2127
2128
 
2128
2129
  const name = account_info.account_type === 'business' ? account_info.business_name : account_info.full_name;
2129
2130
 
2130
- const file_ret = await ai_module.get_profile_avatar(profile_picture, uid, '', account_profile_info, account_info.account_type, 'account', contact_uid, {}, business_size, name, account_info.email, job_id, headers);
2131
+ const file_ret = await ai_module.get_profile_avatar(profile_picture, uid, '', account_profile_info, account_info.account_type, 'account', account_uid, {}, business_size, name, account_info.email, job_id, headers);
2131
2132
 
2132
- let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', contact_uid);
2133
+ let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', account_uid);
2133
2134
  let account_info = account_obj.account_info;
2134
2135
 
2135
2136
  account_info.profile_avatar_obj = file_ret;
2136
2137
  account_info.profile_avatar = account_info.profile_avatar_obj.file_url;
2137
2138
 
2138
2139
  const account_save_ret = await db_module.save_couch_doc('xuda_accounts', account_obj);
2139
- await update_profile_avatar_status(contact_uid, 3);
2140
+ await update_profile_avatar_status(account_uid, 3);
2140
2141
  }
2141
2142
  } catch (error) {
2142
- await update_profile_avatar_status(contact_uid, 1);
2143
+ await update_profile_avatar_status(account_uid, 3);
2143
2144
  }
2144
2145
  };
2145
2146
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1400",
3
+ "version": "1.2.1402",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {