@xuda.io/account_module 1.2.1194 → 1.2.1196

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
@@ -588,7 +588,7 @@ export const get_active_account_profile_info = async function (uid) {
588
588
  }
589
589
  const app_id = await get_account_default_project_id(account_profile_obj.shared_from_uid || account_profile_obj.uid);
590
590
 
591
- return { account_profile_id: active_account_profile_id, app_id, is_main: acc_obj.account_info.active_account_profile_id === acc_obj.account_profile_id, account_profile_obj };
591
+ return { uid: account_profile_obj.shared_from_uid || uid, account_profile_id: active_account_profile_id, app_id, is_main: acc_obj.account_info.active_account_profile_id === acc_obj.account_profile_id, account_profile_obj };
592
592
  };
593
593
 
594
594
  export const get_account_name = async function (req) {
@@ -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 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.1194",
3
+ "version": "1.2.1196",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {