@xuda.io/account_module 1.2.2234 → 1.2.2236
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 +2 -48
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2283,6 +2283,8 @@ export const get_contacts = async function (req, job_id, headers) {
|
|
|
2283
2283
|
|
|
2284
2284
|
if (!account_profile_info.is_main) {
|
|
2285
2285
|
opt.selector.account_profiles = { $in: [account_profile_info.account_profile_id] };
|
|
2286
|
+
} else {
|
|
2287
|
+
// get the user profile, if profile is archived or deleted the exclude
|
|
2286
2288
|
}
|
|
2287
2289
|
|
|
2288
2290
|
switch (filter_type) {
|
|
@@ -2369,54 +2371,6 @@ export const get_contacts = async function (req, job_id, headers) {
|
|
|
2369
2371
|
|
|
2370
2372
|
let contact_docs = { docs: [], total_docs: contacts.total_docs };
|
|
2371
2373
|
|
|
2372
|
-
// const chat_conversation_count = async function () {
|
|
2373
|
-
// // const account_profile_info = await get_active_account_profile_info(uid);
|
|
2374
|
-
|
|
2375
|
-
// const counts_ret = await db_module.get_app_couch_view(account_profile_info.app_id, 'conversations_item_counts', {
|
|
2376
|
-
// reduce: true,
|
|
2377
|
-
// group_level: 999,
|
|
2378
|
-
|
|
2379
|
-
// startkey: ['contacts', '', ''],
|
|
2380
|
-
// endkey: ['contacts', 'zzzzzz', 'zzzzzz'],
|
|
2381
|
-
// });
|
|
2382
|
-
|
|
2383
|
-
// // return counts_ret?.rows?.[0]?.value || 0;
|
|
2384
|
-
|
|
2385
|
-
// let counts = {};
|
|
2386
|
-
// for (const val of counts_ret?.rows) {
|
|
2387
|
-
// if (!counts[val.key[1]]) {
|
|
2388
|
-
// counts[val.key[1]] = 0;
|
|
2389
|
-
// }
|
|
2390
|
-
|
|
2391
|
-
// counts[val.key[1]] += val.value;
|
|
2392
|
-
// }
|
|
2393
|
-
|
|
2394
|
-
// return counts;
|
|
2395
|
-
// };
|
|
2396
|
-
// const chat_conversation_read = async function () {
|
|
2397
|
-
// // const account_profile_info = await get_active_account_profile_info(uid);
|
|
2398
|
-
|
|
2399
|
-
// const counts_ret = await db_module.get_app_couch_view(account_profile_info.app_id, 'chat_conversation_item_read', {
|
|
2400
|
-
// reduce: true,
|
|
2401
|
-
// group_level: 999,
|
|
2402
|
-
|
|
2403
|
-
// startkey: [uid, '', ''],
|
|
2404
|
-
// endkey: [uid, 'zzzzzz', 'zzzzzz'],
|
|
2405
|
-
// });
|
|
2406
|
-
|
|
2407
|
-
// let counts = {};
|
|
2408
|
-
// for (const val of counts_ret?.rows) {
|
|
2409
|
-
// if (!counts[val.key[1]]) {
|
|
2410
|
-
// counts[val.key[1]] = 0;
|
|
2411
|
-
// }
|
|
2412
|
-
// counts[val.key[1]] += val.value;
|
|
2413
|
-
// }
|
|
2414
|
-
// return counts;
|
|
2415
|
-
// };
|
|
2416
|
-
|
|
2417
|
-
// const contact_chat_conversation_count_ret = await chat_conversation_count();
|
|
2418
|
-
// const contact_chat_conversation_read_ret = await chat_conversation_read();
|
|
2419
|
-
// debugger;
|
|
2420
2374
|
for await (let doc of contacts.docs) {
|
|
2421
2375
|
const ret_to = requests_to.docs.find((e) => {
|
|
2422
2376
|
return e.contact_uid === doc.contact_uid;
|