@xuda.io/account_module 1.2.1213 → 1.2.1215
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 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2422,7 +2422,7 @@ export const onboarding_completed = async function (req, job_id, headers) {
|
|
|
2422
2422
|
account_doc.ai_workspace_plan = 'free_ai_workspace';
|
|
2423
2423
|
}
|
|
2424
2424
|
if (!account_doc.account_profile_id) {
|
|
2425
|
-
const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name,
|
|
2425
|
+
const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
|
|
2426
2426
|
account_doc.account_profile_id = account_profile_ret.data.id;
|
|
2427
2427
|
account_doc.account_info.active_account_profile_id = account_doc.account_profile_id;
|
|
2428
2428
|
}
|
|
@@ -2501,7 +2501,7 @@ export const get_account_ai_usage = async function (req, job_id, headers) {
|
|
|
2501
2501
|
};
|
|
2502
2502
|
|
|
2503
2503
|
export const create_account_profile = async function (req, job_id, headers) {
|
|
2504
|
-
const { uid, profile_name, profile_signature, profile_email, profile_picture, profile_avatar, profile_picture_obj, profile_avatar_obj,
|
|
2504
|
+
const { uid, profile_name, profile_signature, profile_email, profile_picture, profile_avatar, profile_picture_obj, profile_avatar_obj, main } = req;
|
|
2505
2505
|
try {
|
|
2506
2506
|
// const app_id = await get_account_default_project_id(uid);
|
|
2507
2507
|
const { data: acc_obj } = await db_module.get_couch_doc('xuda_accounts', uid);
|
|
@@ -2522,7 +2522,7 @@ export const create_account_profile = async function (req, job_id, headers) {
|
|
|
2522
2522
|
profile_avatar,
|
|
2523
2523
|
profile_picture_obj,
|
|
2524
2524
|
profile_avatar_obj,
|
|
2525
|
-
|
|
2525
|
+
main,
|
|
2526
2526
|
};
|
|
2527
2527
|
const save_ret = await db_module.save_couch_doc('xuda_accounts', doc);
|
|
2528
2528
|
// acc_obj.active_profile_id = save_ret.data.id;
|
|
@@ -2792,7 +2792,7 @@ export const get_account_profiles = async function (req) {
|
|
|
2792
2792
|
let profile_docs = { docs: [], total_docs: profiles.total_docs };
|
|
2793
2793
|
for await (let doc of profiles.docs) {
|
|
2794
2794
|
doc = await get_account_profile_info(uid, doc);
|
|
2795
|
-
if (doc.
|
|
2795
|
+
if (doc.main) {
|
|
2796
2796
|
profile_docs.docs.unshift(doc);
|
|
2797
2797
|
} else {
|
|
2798
2798
|
profile_docs.docs.push(doc);
|
|
@@ -2824,7 +2824,7 @@ export const archive_account_profile = async function (req) {
|
|
|
2824
2824
|
|
|
2825
2825
|
var account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
|
|
2826
2826
|
|
|
2827
|
-
if (account_profile_doc.
|
|
2827
|
+
if (account_profile_doc.main) {
|
|
2828
2828
|
throw new Error('reserve');
|
|
2829
2829
|
}
|
|
2830
2830
|
// if (!account_profile_doc.team_req_id) {
|