@xuda.io/account_module 1.2.235 → 1.2.237

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 +8 -6
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -510,7 +510,7 @@ export const get_account_name = async function (req) {
510
510
  date_created_ts,
511
511
  };
512
512
  if (data.data.account_info) {
513
- const { first_name, last_name, email, phone, profile_picture, username, website, country, bio, industry } = data.data.account_info;
513
+ const { first_name, last_name, email, phone, profile_picture, profile_avatar, username, website, country, bio, industry } = data.data.account_info;
514
514
 
515
515
  obj = {
516
516
  first_name,
@@ -518,6 +518,7 @@ export const get_account_name = async function (req) {
518
518
  email,
519
519
  phone,
520
520
  profile_picture,
521
+ profile_avatar,
521
522
  username,
522
523
  website,
523
524
  country,
@@ -1173,12 +1174,14 @@ export const add_contact = async function (req, job_id, headers) {
1173
1174
  }
1174
1175
 
1175
1176
  let profile_picture;
1177
+ let profile_avatar;
1176
1178
  if (contact_uid) {
1177
1179
  const account_ret = await get_account_name({ uid_query: contact_uid });
1178
1180
  if (account_ret.code < 0) {
1179
1181
  throw new Error(`account ${contact_uid} not found`);
1180
1182
  }
1181
1183
  profile_picture = account_ret.data.profile_picture;
1184
+ profile_avatar = account_ret.data.profile_avatar;
1182
1185
  }
1183
1186
  const d = Date.now();
1184
1187
  const doc = {
@@ -1199,11 +1202,10 @@ export const add_contact = async function (req, job_id, headers) {
1199
1202
  const ret = await db_module.save_couch_doc('xuda_contacts', doc);
1200
1203
 
1201
1204
  const app_id = await get_account_default_project_id(uid);
1202
-
1203
- const ai_module = await import(`${module_path}/ai_module/index.mjs`);
1204
-
1205
- ai_module.update_thumbnail('contact', doc, app_id, uid, job_id, headers, 'xuda_contacts');
1206
-
1205
+ if (!profile_avatar) {
1206
+ const ai_module = await import(`${module_path}/ai_module/index.mjs`);
1207
+ ai_module.update_thumbnail('contact', doc, app_id, uid, job_id, headers, 'xuda_contacts');
1208
+ }
1207
1209
  return ret;
1208
1210
  } catch (err) {
1209
1211
  return { code: -1, data: err.message };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.235",
3
+ "version": "1.2.237",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {