@xuda.io/account_module 1.2.1292 → 1.2.1294

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 +19 -8
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1584,11 +1584,11 @@ export const update_contact = async function (req) {
1584
1584
  const account_profile_info = await get_active_account_profile_info(uid);
1585
1585
 
1586
1586
  var contact_ret;
1587
- if (email) {
1588
- contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [account_profile_info.uid, email] });
1589
- } else if (contact_uid) {
1590
- contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [account_profile_info.uid, contact_uid] });
1591
- }
1587
+ // if (email) {
1588
+ // contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_user_email_address', { key: [account_profile_info.uid, email] });
1589
+ // } else if (contact_uid) {
1590
+ // contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [account_profile_info.uid, contact_uid] });
1591
+ // }
1592
1592
 
1593
1593
  let opt = {
1594
1594
  selector: {
@@ -1607,8 +1607,8 @@ export const update_contact = async function (req) {
1607
1607
 
1608
1608
  contact_ret = await find_contact_query(account_profile_info.uid, opt);
1609
1609
 
1610
- if (contact_ret.rows.length) {
1611
- var doc = contact_ret.rows[0].value;
1610
+ if (contact_ret.docs.length) {
1611
+ var doc = contact_ret.docs[0];
1612
1612
  if (stat) {
1613
1613
  doc.stat = stat;
1614
1614
  doc.stat_ts = Date.now();
@@ -1936,7 +1936,18 @@ export const get_user_card = async function (uid, uid_query) {
1936
1936
 
1937
1937
  const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [uid, uid_query] });
1938
1938
 
1939
- const contact_id = contact_ret?.rows?.[0]?.id;
1939
+ const opt = {
1940
+ selector: {
1941
+ docType: 'contact',
1942
+ stat: 3,
1943
+ contact_uid: uid_query,
1944
+ },
1945
+ limit: 1,
1946
+ fields: ['_id'],
1947
+ };
1948
+ const user_contacts = await find_contact_query(uid, opt);
1949
+
1950
+ const contact_id = contact_ret?.docs?.[0]?._id;
1940
1951
  if (contact_id) {
1941
1952
  user_contact_obj = await get_contact_info(uid, null, contact_id);
1942
1953
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1292",
3
+ "version": "1.2.1294",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {