@xuda.io/account_module 1.2.886 → 1.2.888
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 +5 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1613,7 +1613,7 @@ export const get_contacts = async function (req) {
|
|
|
1613
1613
|
opt.bookmark = bookmark;
|
|
1614
1614
|
}
|
|
1615
1615
|
|
|
1616
|
-
let contacts = { docs: [] };
|
|
1616
|
+
let contacts = { docs: [], total_docs: 0 };
|
|
1617
1617
|
|
|
1618
1618
|
if (filter_type !== 'pending') {
|
|
1619
1619
|
contacts = await db_module.find_couch_query('xuda_contacts', opt);
|
|
@@ -1634,7 +1634,7 @@ export const get_contacts = async function (req) {
|
|
|
1634
1634
|
let requests_from = { docs: [], total_docs: 0 };
|
|
1635
1635
|
let shared_from = { docs: [], total_docs: 0 };
|
|
1636
1636
|
let my_contact = { docs: [], total_docs: 0 };
|
|
1637
|
-
let contact_docs = { docs: [], total_docs:
|
|
1637
|
+
let contact_docs = { docs: [], total_docs: contacts.total_docs };
|
|
1638
1638
|
for await (let doc of contacts.docs) {
|
|
1639
1639
|
const ret_to = requests_to.docs.find((e) => {
|
|
1640
1640
|
return e.contact_uid === doc.contact_uid;
|
|
@@ -1654,10 +1654,13 @@ export const get_contacts = async function (req) {
|
|
|
1654
1654
|
if (filter_type === 'pending') {
|
|
1655
1655
|
////// TO - OUT
|
|
1656
1656
|
requests_to.docs = await get_pending_contact_out(uid);
|
|
1657
|
+
requests_to.total_docs = requests_to.docs.length;
|
|
1657
1658
|
|
|
1658
1659
|
////// FROM - IN
|
|
1659
1660
|
requests_from.docs = await get_pending_contact_in(uid);
|
|
1661
|
+
requests_from.total_docs = requests_from.docs.length;
|
|
1660
1662
|
shared_from.docs = await get_pending_share_contact_in(uid);
|
|
1663
|
+
shared_from.total_docs = shared_from.docs.length;
|
|
1661
1664
|
}
|
|
1662
1665
|
// my contact
|
|
1663
1666
|
if (filter_type === 'all' && !search && contact_docs.docs.length) {
|