@xuda.io/account_module 1.2.1200 → 1.2.1202

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 +14 -13
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1600,6 +1600,7 @@ const get_user_contact = async function (uid, uid_query) {
1600
1600
  export const get_contacts = async function (req) {
1601
1601
  const { _id, uid, name, limit, skip, bookmark, search, filter_type = 'all', contact_id } = req;
1602
1602
 
1603
+ const account_profile_info = await get_active_account_profile_info(uid);
1603
1604
  if (_id) {
1604
1605
  let data = await db_module.get_couch_doc('xuda_contacts', _id);
1605
1606
  return data;
@@ -1609,7 +1610,7 @@ export const get_contacts = async function (req) {
1609
1610
  var opt = {
1610
1611
  selector: {
1611
1612
  docType: 'contact',
1612
- uid,
1613
+ uid: account_profile_info.uid,
1613
1614
  stat: { $lt: 4 },
1614
1615
  },
1615
1616
  limit: limit || 9999,
@@ -2017,9 +2018,9 @@ export const update_contact = async function (req) {
2017
2018
 
2018
2019
  var contact_ret;
2019
2020
  if (email) {
2020
- 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] });
2021
+ contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [account_profile_info.uid, email] });
2021
2022
  } else if (contact_uid) {
2022
- contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [uid, contact_uid] });
2023
+ contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [account_profile_info.uid, contact_uid] });
2023
2024
  }
2024
2025
  if (contact_ret.rows.length) {
2025
2026
  var doc = contact_ret.rows[0].value;
@@ -2042,18 +2043,18 @@ export const update_contact = async function (req) {
2042
2043
  }
2043
2044
  return { code: -1, data: 'contact not found' };
2044
2045
  };
2045
- export const invite_user = async function (req) {
2046
- const { email, name, uid } = req;
2046
+ // export const invite_user = async function (req) {
2047
+ // const { email, name, uid } = req;
2047
2048
 
2048
- const team_module = await import(`${module_path}/team_module/index.mjs`);
2049
- const ret = await team_module.create_team_request({
2050
- email,
2051
- access_type: 'contact',
2052
- uid,
2053
- });
2049
+ // const team_module = await import(`${module_path}/team_module/index.mjs`);
2050
+ // const ret = await team_module.create_team_request({
2051
+ // email,
2052
+ // access_type: 'contact',
2053
+ // uid,
2054
+ // });
2054
2055
 
2055
- // return { code: -1, data: "contact already exist active or deleted" };
2056
- };
2056
+ // // return { code: -1, data: "contact already exist active or deleted" };
2057
+ // };
2057
2058
 
2058
2059
  export const get_account_rt_info = async function (uid) {
2059
2060
  const doc_ret = await db_module.get_couch_doc('xuda_accounts', uid);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1200",
3
+ "version": "1.2.1202",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {