@xuda.io/account_module 1.2.500 → 1.2.502
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 +34 -30
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1257,8 +1257,11 @@ const get_contact_border = function (doc) {
|
|
|
1257
1257
|
return ret;
|
|
1258
1258
|
};
|
|
1259
1259
|
|
|
1260
|
-
export const get_contact_info = async function (contact_doc) {
|
|
1260
|
+
export const get_contact_info = async function (contact_doc, _id) {
|
|
1261
1261
|
let doc = contact_doc;
|
|
1262
|
+
if (_id) {
|
|
1263
|
+
doc = await db_module.get_couch_doc_native('xuda_contacts', _id);
|
|
1264
|
+
}
|
|
1262
1265
|
|
|
1263
1266
|
if (doc.contact_uid) {
|
|
1264
1267
|
const account_info_ret = await get_account_name({ uid_query: doc.contact_uid });
|
|
@@ -1355,42 +1358,43 @@ export const get_contacts = async function (req) {
|
|
|
1355
1358
|
const contacts = await db_module.find_couch_query('xuda_contacts', opt);
|
|
1356
1359
|
|
|
1357
1360
|
for await (let doc of contacts.docs) {
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1361
|
+
// if (doc.contact_uid) {
|
|
1362
|
+
// const account_info_ret = await get_account_name({ uid_query: doc.contact_uid });
|
|
1363
|
+
// if (account_info_ret.code < 0) {
|
|
1364
|
+
// continue; // throw new Error(`account ${contact_uid} not found`);
|
|
1365
|
+
// }
|
|
1363
1366
|
|
|
1364
|
-
|
|
1367
|
+
// doc.profile_avatar = account_info_ret.data.profile_avatar;
|
|
1365
1368
|
|
|
1366
|
-
|
|
1369
|
+
// doc.card_background = get_contact_background(doc);
|
|
1367
1370
|
|
|
1368
|
-
|
|
1369
|
-
|
|
1371
|
+
// //membership_plan
|
|
1372
|
+
// doc.name = `${account_info_ret.data.first_name} ${account_info_ret.data.last_name}`;
|
|
1370
1373
|
|
|
1371
|
-
|
|
1374
|
+
// doc.telephone = account_info_ret.data.phone;
|
|
1372
1375
|
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1376
|
+
// // doc.notifications = 45;
|
|
1377
|
+
// // doc.online = true;
|
|
1378
|
+
// if (doc.team_req_id) {
|
|
1379
|
+
// try {
|
|
1380
|
+
// const req_doc = await db_module.get_couch_doc_native('xuda_team', doc.team_req_id);
|
|
1381
|
+
// doc.connection_stat = req_doc.team_req_stat;
|
|
1382
|
+
// } catch (error) {
|
|
1383
|
+
// doc.connection_stat = 0;
|
|
1384
|
+
// }
|
|
1385
|
+
// }
|
|
1383
1386
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1387
|
+
// doc.icon_pattern = get_contact_pattern(doc);
|
|
1388
|
+
// }
|
|
1389
|
+
// doc.border = get_contact_border(doc);
|
|
1390
|
+
// if (!doc.name) {
|
|
1391
|
+
// doc.name = doc.email;
|
|
1392
|
+
// }
|
|
1393
|
+
|
|
1394
|
+
// doc.email = '';
|
|
1395
|
+
doc = await get_contact_info(doc);
|
|
1396
|
+
}
|
|
1390
1397
|
|
|
1391
|
-
// doc.email = '';
|
|
1392
|
-
// }
|
|
1393
|
-
doc=await get_contact_info(doc)
|
|
1394
1398
|
let requests_to = { docs: [] };
|
|
1395
1399
|
let requests_from = { docs: [] };
|
|
1396
1400
|
|