@xuda.io/account_module 1.2.493 → 1.2.494
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 +26 -30
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1258,45 +1258,41 @@ const get_contact_border = function (doc) {
|
|
|
1258
1258
|
};
|
|
1259
1259
|
|
|
1260
1260
|
export const get_contact_info = async function (doc) {
|
|
1261
|
+
if (doc.contact_uid) {
|
|
1262
|
+
const account_info_ret = await get_account_name({ uid_query: doc.contact_uid });
|
|
1263
|
+
if (account_info_ret.code < 0) {
|
|
1264
|
+
return; // throw new Error(`account ${contact_uid} not found`);
|
|
1265
|
+
}
|
|
1261
1266
|
|
|
1262
|
-
|
|
1263
|
-
const account_info_ret = await get_account_name({ uid_query: doc.contact_uid });
|
|
1264
|
-
if (account_info_ret.code < 0) {
|
|
1265
|
-
continue; // throw new Error(`account ${contact_uid} not found`);
|
|
1266
|
-
}
|
|
1267
|
+
doc.profile_avatar = account_info_ret.data.profile_avatar;
|
|
1267
1268
|
|
|
1268
|
-
|
|
1269
|
+
doc.card_background = get_contact_background(doc);
|
|
1269
1270
|
|
|
1270
|
-
|
|
1271
|
+
//membership_plan
|
|
1272
|
+
doc.name = `${account_info_ret.data.first_name} ${account_info_ret.data.last_name}`;
|
|
1271
1273
|
|
|
1272
|
-
|
|
1273
|
-
doc.name = `${account_info_ret.data.first_name} ${account_info_ret.data.last_name}`;
|
|
1274
|
-
|
|
1275
|
-
doc.telephone = account_info_ret.data.phone;
|
|
1274
|
+
doc.telephone = account_info_ret.data.phone;
|
|
1276
1275
|
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
}
|
|
1276
|
+
// doc.notifications = 45;
|
|
1277
|
+
// doc.online = true;
|
|
1278
|
+
if (doc.team_req_id) {
|
|
1279
|
+
try {
|
|
1280
|
+
const req_doc = await db_module.get_couch_doc_native('xuda_team', doc.team_req_id);
|
|
1281
|
+
doc.connection_stat = req_doc.team_req_stat;
|
|
1282
|
+
} catch (error) {
|
|
1283
|
+
doc.connection_stat = 0;
|
|
1286
1284
|
}
|
|
1287
|
-
|
|
1288
|
-
doc.icon_pattern = get_contact_pattern(doc);
|
|
1289
1285
|
}
|
|
1290
|
-
doc.border = get_contact_border(doc);
|
|
1291
|
-
if (!doc.name) {
|
|
1292
|
-
doc.name = doc.email;
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
doc.email = '';
|
|
1296
|
-
|
|
1297
1286
|
|
|
1287
|
+
doc.icon_pattern = get_contact_pattern(doc);
|
|
1288
|
+
}
|
|
1289
|
+
doc.border = get_contact_border(doc);
|
|
1290
|
+
if (!doc.name) {
|
|
1291
|
+
doc.name = doc.email;
|
|
1292
|
+
}
|
|
1298
1293
|
|
|
1299
|
-
|
|
1294
|
+
doc.email = '';
|
|
1295
|
+
};
|
|
1300
1296
|
|
|
1301
1297
|
export const get_contacts = async function (req) {
|
|
1302
1298
|
const { _id, uid, name, limit, skip, bookmark, search, with_requests } = req;
|