@xuda.io/account_module 1.2.858 → 1.2.860

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 +17 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1549,7 +1549,19 @@ const get_user_contact = async function (uid, uid_query) {
1549
1549
  };
1550
1550
 
1551
1551
  export const get_contacts = async function (req) {
1552
- const { _id, uid, name, limit, skip, bookmark, search, filter_type = 'all' } = req;
1552
+ const { _id, uid, name, limit, skip, bookmark, search, filter_type = 'all', contact_id } = req;
1553
+
1554
+ // if (_id) {
1555
+ // let doc_ret = await get_ai_doc({ _id, uid });
1556
+
1557
+ // return doc_ret;
1558
+ // }
1559
+
1560
+ if (_id) {
1561
+ let data = await db_module.get_couch_doc('xuda_contacts', _id);
1562
+ return data;
1563
+ }
1564
+
1553
1565
  let { with_requests } = req;
1554
1566
  var opt = {
1555
1567
  selector: {
@@ -1580,6 +1592,10 @@ export const get_contacts = async function (req) {
1580
1592
  opt.selector._id = _id;
1581
1593
  }
1582
1594
 
1595
+ if (contact_id) {
1596
+ opt.selector._id = contact_id;
1597
+ }
1598
+
1583
1599
  if (typeof name !== 'undefined') {
1584
1600
  opt.selector.name = { $regex: `(?i)${name}` };
1585
1601
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.858",
3
+ "version": "1.2.860",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {