@xuda.io/account_module 1.2.797 → 1.2.799
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.
- package/index.mjs +6 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1535,7 +1535,7 @@ const get_user_contact = async function (uid, uid_query) {
|
|
|
1535
1535
|
};
|
|
1536
1536
|
|
|
1537
1537
|
export const get_contacts = async function (req) {
|
|
1538
|
-
const { _id, uid, name, limit, skip, bookmark, search, with_requests } = req;
|
|
1538
|
+
const { _id, uid, name, limit, skip, bookmark, search, with_requests, filter_type = 'all' } = req;
|
|
1539
1539
|
var opt = {
|
|
1540
1540
|
selector: {
|
|
1541
1541
|
docType: 'contact',
|
|
@@ -1569,15 +1569,15 @@ export const get_contacts = async function (req) {
|
|
|
1569
1569
|
];
|
|
1570
1570
|
}
|
|
1571
1571
|
|
|
1572
|
-
if (skip) {
|
|
1573
|
-
opt.skip = skip;
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
1572
|
if (bookmark && bookmark !== 'nil') {
|
|
1577
1573
|
opt.bookmark = bookmark;
|
|
1578
1574
|
}
|
|
1579
1575
|
|
|
1580
|
-
|
|
1576
|
+
let contacts = [];
|
|
1577
|
+
|
|
1578
|
+
if (filter_type !== 'pending') {
|
|
1579
|
+
contacts = await db_module.find_couch_query('xuda_contacts', opt);
|
|
1580
|
+
}
|
|
1581
1581
|
|
|
1582
1582
|
let requests_to = { docs: [] };
|
|
1583
1583
|
let requests_from = { docs: [] };
|