@xuda.io/account_module 1.2.1289 → 1.2.1291

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 +15 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1589,6 +1589,18 @@ export const update_contact = async function (req) {
1589
1589
  } else if (contact_uid) {
1590
1590
  contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [account_profile_info.uid, contact_uid] });
1591
1591
  }
1592
+
1593
+ let opt = {
1594
+ selector: {
1595
+ docType: 'contact',
1596
+ stat: 3,
1597
+ email,
1598
+ },
1599
+ limit: 1,
1600
+ fields: ['_id'],
1601
+ };
1602
+ const user_contacts = await find_contact_query(account_profile_info.uid, opt);
1603
+
1592
1604
  if (contact_ret.rows.length) {
1593
1605
  var doc = contact_ret.rows[0].value;
1594
1606
  if (stat) {
@@ -2211,7 +2223,7 @@ export const get_contacts = async function (req) {
2211
2223
  var opt = {
2212
2224
  selector: {
2213
2225
  docType: 'contact',
2214
- uid: account_profile_info.uid,
2226
+ // uid: account_profile_info.uid,
2215
2227
  stat: { $lt: 4 },
2216
2228
  },
2217
2229
  limit: limit || 9999,
@@ -2278,7 +2290,7 @@ export const get_contacts = async function (req) {
2278
2290
  let contacts = { docs: [], total_docs: 0 };
2279
2291
 
2280
2292
  if (filter_type !== 'pending') {
2281
- contacts = await db_module.find_couch_query('xuda_contacts', opt);
2293
+ contacts = await find_contact_query(account_profile_info.uid, opt);
2282
2294
  if (!limit || contact_id) {
2283
2295
  contacts.total_docs = contacts.docs.length;
2284
2296
  } else {
@@ -2287,7 +2299,7 @@ export const get_contacts = async function (req) {
2287
2299
  opt.limit = 9999;
2288
2300
  opt.fields = ['_id'];
2289
2301
 
2290
- const counter = await db_module.find_couch_query('xuda_contacts', opt);
2302
+ const counter = await find_contact_query(account_profile_info.uid, opt);
2291
2303
  contacts.total_docs = counter.docs.length;
2292
2304
  }
2293
2305
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1289",
3
+ "version": "1.2.1291",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {