@xuda.io/account_module 1.2.1033 → 1.2.1034
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
|
@@ -2556,12 +2556,12 @@ export const get_profiles = async function (req) {
|
|
|
2556
2556
|
opt.bookmark = bookmark;
|
|
2557
2557
|
}
|
|
2558
2558
|
|
|
2559
|
-
let
|
|
2559
|
+
let profiles = { docs: [], total_docs: 0 };
|
|
2560
2560
|
|
|
2561
2561
|
if (filter_type !== 'pending') {
|
|
2562
|
-
|
|
2562
|
+
profiles = await db_module.find_couch_query('xuda_accounts', opt);
|
|
2563
2563
|
if (!limit || profile_id) {
|
|
2564
|
-
|
|
2564
|
+
profiles.total_docs = profiles.docs.length;
|
|
2565
2565
|
} else {
|
|
2566
2566
|
delete opt.sort;
|
|
2567
2567
|
delete opt.skip;
|
|
@@ -2569,7 +2569,7 @@ export const get_profiles = async function (req) {
|
|
|
2569
2569
|
opt.fields = ['_id'];
|
|
2570
2570
|
|
|
2571
2571
|
const counter = await db_module.find_couch_query('xuda_contacts', opt);
|
|
2572
|
-
|
|
2572
|
+
profiles.total_docs = counter.docs.length;
|
|
2573
2573
|
}
|
|
2574
2574
|
}
|
|
2575
2575
|
|
|
@@ -2577,8 +2577,8 @@ export const get_profiles = async function (req) {
|
|
|
2577
2577
|
let requests_from = { docs: [], total_docs: 0 };
|
|
2578
2578
|
let shared_from = { docs: [], total_docs: 0 };
|
|
2579
2579
|
let my_contact = { docs: [], total_docs: 0 };
|
|
2580
|
-
let contact_docs = { docs: [], total_docs:
|
|
2581
|
-
for await (let doc of
|
|
2580
|
+
let contact_docs = { docs: [], total_docs: profiles.total_docs };
|
|
2581
|
+
for await (let doc of profiles.docs) {
|
|
2582
2582
|
const ret_to = requests_to.docs.find((e) => {
|
|
2583
2583
|
return e.contact_uid === doc.contact_uid;
|
|
2584
2584
|
});
|