@xuda.io/account_module 1.2.1193 → 1.2.1195

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 -6
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1992,7 +1992,7 @@ export const add_contact = async function (req, job_id, headers) {
1992
1992
  if (!doc.profile_avatar) {
1993
1993
  // create factual avatar
1994
1994
  if (!is_spam) {
1995
- ai_module.update_thumbnail('contact', doc, app_id, uid, job_id, headers, 'xuda_contacts', [email, doc._id, 'contact', app_id]);
1995
+ ai_module.update_thumbnail('contact', doc, account_profile_info.app_id, uid, job_id, headers, 'xuda_contacts', [email, doc._id, 'contact', account_profile_info.app_id], account_profile_info);
1996
1996
  }
1997
1997
  }
1998
1998
  }
@@ -2003,16 +2003,19 @@ export const add_contact = async function (req, job_id, headers) {
2003
2003
  }
2004
2004
  };
2005
2005
 
2006
- const get_contact_id = async function (uid, contact_uid) {
2007
- contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [uid, contact_uid] });
2008
- return contact_ret?.rows?.[0]?.id;
2009
- };
2006
+ // const get_contact_id = async function (uid, contact_uid) {
2007
+ // contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [uid, contact_uid] });
2008
+ // return contact_ret?.rows?.[0]?.id;
2009
+ // };
2010
2010
 
2011
2011
  export const update_contact = async function (req) {
2012
2012
  const { uid, email, contact_uid, stat, team_req_id } = req;
2013
+
2014
+ const account_profile_info = await account_module.get_active_account_profile_info(uid);
2015
+
2013
2016
  var contact_ret;
2014
2017
  if (email) {
2015
- contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [uid, email] });
2018
+ contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [account_profile_info.account_profile_obj.shared_from_uid, email] });
2016
2019
  } else if (contact_uid) {
2017
2020
  contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [uid, contact_uid] });
2018
2021
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1193",
3
+ "version": "1.2.1195",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {