@xuda.io/account_module 1.2.885 → 1.2.886
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 +11 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1617,6 +1617,17 @@ export const get_contacts = async function (req) {
|
|
|
1617
1617
|
|
|
1618
1618
|
if (filter_type !== 'pending') {
|
|
1619
1619
|
contacts = await db_module.find_couch_query('xuda_contacts', opt);
|
|
1620
|
+
if (!limit || contact_id) {
|
|
1621
|
+
contacts.total_docs = contacts.docs.length;
|
|
1622
|
+
} else {
|
|
1623
|
+
delete opt.sort;
|
|
1624
|
+
delete opt.skip;
|
|
1625
|
+
opt.limit = 9999;
|
|
1626
|
+
opt.fields = ['_id'];
|
|
1627
|
+
|
|
1628
|
+
const counter = await db_module.find_couch_query('xuda_contacts', opt);
|
|
1629
|
+
contacts.total_docs = counter.docs.length;
|
|
1630
|
+
}
|
|
1620
1631
|
}
|
|
1621
1632
|
|
|
1622
1633
|
let requests_to = { docs: [], total_docs: 0 };
|