@xuda.io/account_module 1.2.1066 → 1.2.1068
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 +56 -27
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2501,38 +2501,67 @@ export const get_account_profile_info = async function (uid, contact_profile_doc
|
|
|
2501
2501
|
doc.profile_avatar = account_info_ret.data.profile_avatar;
|
|
2502
2502
|
}
|
|
2503
2503
|
|
|
2504
|
-
doc.name = account_info_ret.data?.account_type === 'business' ? account_info_ret.data.business_name : `${account_info_ret.data.first_name} ${account_info_ret.data.last_name}`;
|
|
2504
|
+
// doc.name = account_info_ret.data?.account_type === 'business' ? account_info_ret.data.business_name : `${account_info_ret.data.first_name} ${account_info_ret.data.last_name}`;
|
|
2505
|
+
|
|
2506
|
+
// if (account_info_ret.data.phone_number) {
|
|
2507
|
+
// try {
|
|
2508
|
+
// doc.phone_number = formatPhoneWithFlag(account_info_ret.data.phone_number, account_info_ret.data.country);
|
|
2509
|
+
// } catch (err) {
|
|
2510
|
+
// console.error(err);
|
|
2511
|
+
// doc.phone_number = account_info_ret.data.phone_number;
|
|
2512
|
+
// }
|
|
2513
|
+
// }
|
|
2505
2514
|
|
|
2506
|
-
if (
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
}
|
|
2515
|
+
// if (doc.team_req_id) {
|
|
2516
|
+
// try {
|
|
2517
|
+
// const req_doc = await db_module.get_couch_doc_native('xuda_team', doc.team_req_id);
|
|
2518
|
+
// doc.connection_stat = req_doc.team_req_stat;
|
|
2519
|
+
// doc.connection_type = req_doc.access_type;
|
|
2520
|
+
// if (doc.connection_type === 'contact_connection') {
|
|
2521
|
+
// doc.friend_since = req_doc.team_req_date;
|
|
2522
|
+
// }
|
|
2523
|
+
// } catch (err) {
|
|
2524
|
+
// if (err.message === 'deleted') {
|
|
2525
|
+
// try {
|
|
2526
|
+
// let contact_doc = await db_module.get_couch_doc_native('xuda_contacts', doc._id);
|
|
2527
|
+
// contact_doc.team_req_id = '';
|
|
2528
|
+
// await db_module.save_couch_doc('xuda_contacts', contact_doc);
|
|
2529
|
+
// } catch (error) {}
|
|
2530
|
+
// }
|
|
2531
|
+
// doc.connection_stat = 0;
|
|
2532
|
+
// }
|
|
2533
|
+
// }
|
|
2514
2534
|
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2535
|
+
const get_pattern = async function (doc) {
|
|
2536
|
+
let ret = `default-pattern.png`;
|
|
2537
|
+
|
|
2538
|
+
if (doc.account_type === 'business') {
|
|
2539
|
+
ret = doc.profile_picture;
|
|
2540
|
+
} else {
|
|
2541
|
+
switch (doc.avatar_source) {
|
|
2542
|
+
case 'fictional':
|
|
2543
|
+
ret = `fictional-avatar-pattern.png`;
|
|
2544
|
+
break;
|
|
2545
|
+
|
|
2546
|
+
case 'ai profile':
|
|
2547
|
+
ret = `fictional-avatar-pattern.png`;
|
|
2548
|
+
break;
|
|
2549
|
+
|
|
2550
|
+
case 'authentic profile':
|
|
2551
|
+
ret = `authentic-avatar-pattern.png`;
|
|
2552
|
+
break;
|
|
2553
|
+
|
|
2554
|
+
default:
|
|
2555
|
+
ret = `xu-pattern.png`;
|
|
2556
|
+
break;
|
|
2530
2557
|
}
|
|
2531
|
-
doc.connection_stat = 0;
|
|
2532
2558
|
}
|
|
2533
|
-
|
|
2559
|
+
|
|
2560
|
+
return ret;
|
|
2561
|
+
};
|
|
2562
|
+
|
|
2534
2563
|
doc.avatar_source = account_info_ret.data.avatar_source;
|
|
2535
|
-
doc.icon_pattern = await
|
|
2564
|
+
doc.icon_pattern = await get_pattern(doc);
|
|
2536
2565
|
doc.username = account_info_ret.data.username;
|
|
2537
2566
|
doc.business_name = account_info_ret.data.business_name;
|
|
2538
2567
|
doc.address = account_info_ret.data.address;
|