@xuda.io/account_module 1.2.390 → 1.2.392
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 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1204,15 +1204,15 @@ export const get_contacts = async function (req) {
|
|
|
1204
1204
|
let requests_from = { docs: [] };
|
|
1205
1205
|
|
|
1206
1206
|
if (with_requests) {
|
|
1207
|
-
|
|
1208
|
-
const
|
|
1207
|
+
////// TO
|
|
1208
|
+
const requests_to_res = await db_module.find_couch_query('xuda_team', {
|
|
1209
1209
|
selector: { docType: 'team_request', access_type: 'contact', team_req_stat: 2, team_req_from_uid: uid },
|
|
1210
1210
|
fields: ['_id', 'team_req_date', 'team_req_to_uid', 'team_req_to_email', 'sender_account_info.email', 'sender_account_info.first_name', 'sender_account_info.last_name', 'sender_account_info.profile_avatar', 'team_req_from_uid'],
|
|
1211
1211
|
});
|
|
1212
1212
|
|
|
1213
|
-
for await (let doc of
|
|
1214
|
-
if (doc.
|
|
1215
|
-
const account_ret = await get_account_name({ uid_query: doc.
|
|
1213
|
+
for await (let doc of requests_to_res.docs) {
|
|
1214
|
+
if (doc.team_req_to_uid) {
|
|
1215
|
+
const account_ret = await get_account_name({ uid_query: doc.team_req_to_uid });
|
|
1216
1216
|
if (account_ret.code < 0) {
|
|
1217
1217
|
continue; // throw new Error(`account ${contact_uid} not found`);
|
|
1218
1218
|
}
|
|
@@ -1220,6 +1220,7 @@ export const get_contacts = async function (req) {
|
|
|
1220
1220
|
}
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
|
+
////// FROM
|
|
1223
1224
|
// requests_from = await db_module.find_couch_query('xuda_team', { selector: { docType: 'team_request', access_type: 'contact', team_req_stat: 2, team_req_from_uid: uid }, fields: ['_id', 'team_req_date', 'team_req_to_email', 'team_req_from_uid'] });
|
|
1224
1225
|
}
|
|
1225
1226
|
|