@xuda.io/account_module 1.2.393 → 1.2.395
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 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1210,16 +1210,17 @@ export const get_contacts = async function (req) {
|
|
|
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
|
|
1214
|
-
let
|
|
1213
|
+
for await (let e of requests_to_res.docs) {
|
|
1214
|
+
let doc = { docType: 'contact', date_created: e.team_req_date, email: [e.team_req_to_email], name: '', profile_avatar: _conf.anonymous_image_url, pending: true, uid: e.team_req_from_uid, team_req_id: e._id };
|
|
1215
1215
|
|
|
1216
|
-
if (
|
|
1217
|
-
const account_ret = await get_account_name({ uid_query:
|
|
1216
|
+
if (e.team_req_to_uid) {
|
|
1217
|
+
const account_ret = await get_account_name({ uid_query: e.team_req_to_uid });
|
|
1218
1218
|
if (account_ret.code < 0) {
|
|
1219
1219
|
continue; // throw new Error(`account ${contact_uid} not found`);
|
|
1220
1220
|
}
|
|
1221
1221
|
doc.profile_avatar = account_ret.data.profile_avatar;
|
|
1222
1222
|
}
|
|
1223
|
+
requests_to.docs.push(doc);
|
|
1223
1224
|
}
|
|
1224
1225
|
|
|
1225
1226
|
////// FROM
|