@xuda.io/account_module 1.2.1225 → 1.2.1227
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 +16 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2684,6 +2684,17 @@ export const get_account_profile_info = async function (uid, contact_profile_doc
|
|
|
2684
2684
|
}
|
|
2685
2685
|
return colour;
|
|
2686
2686
|
};
|
|
2687
|
+
const get_members = async () => {
|
|
2688
|
+
let members = [];
|
|
2689
|
+
let selector = { docType: 'team_request', team_req_stat: 3, share_item_id: doc._id, access_type: 'account_profile', team_req_from_uid: uid };
|
|
2690
|
+
let ret = await db_module.find_couch_query('xuda_team', { selector });
|
|
2691
|
+
for (const req_obj of ret.docs) {
|
|
2692
|
+
const account_info_ret = await get_account_name({ uid_query: req_obj.team_req_to_uid });
|
|
2693
|
+
const info = await await get_contact_info(uid, account_info_ret.data);
|
|
2694
|
+
members.push(info);
|
|
2695
|
+
}
|
|
2696
|
+
return members;
|
|
2697
|
+
};
|
|
2687
2698
|
|
|
2688
2699
|
// Usage examples:
|
|
2689
2700
|
console.log(stringToColour('User A')); // -> Consistent color for "User A"
|
|
@@ -2704,10 +2715,13 @@ export const get_account_profile_info = async function (uid, contact_profile_doc
|
|
|
2704
2715
|
|
|
2705
2716
|
doc.card_background = `linear-gradient(145deg, #242480 0%, #060619 100%)`;
|
|
2706
2717
|
// doc.border = get_contact_border(doc);
|
|
2718
|
+
|
|
2719
|
+
doc.members = await get_members();
|
|
2720
|
+
|
|
2707
2721
|
debugger;
|
|
2708
2722
|
const usage_ret = await get_account_ai_usage({ uid });
|
|
2709
|
-
doc.
|
|
2710
|
-
doc.
|
|
2723
|
+
doc.max_credits = usage_ret.data.credits.total;
|
|
2724
|
+
doc.used_credits = usage_ret.data.usage.total;
|
|
2711
2725
|
|
|
2712
2726
|
return doc;
|
|
2713
2727
|
};
|