@xuda.io/account_module 1.2.1308 → 1.2.1310
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 +10 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -488,6 +488,9 @@ export const get_account_data = async function (req) {
|
|
|
488
488
|
_design = await db_module.get_app_couch_doc_native(acc_obj.account_project_id, '_design/xuda');
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
+
if (!account_doc.account_profile_id) {
|
|
492
|
+
}
|
|
493
|
+
|
|
491
494
|
var ret = { code: 1 };
|
|
492
495
|
ret.data = {
|
|
493
496
|
_id: acc_obj._id,
|
|
@@ -2016,12 +2019,18 @@ export const onboarding_completed = async function (req, job_id, headers) {
|
|
|
2016
2019
|
}
|
|
2017
2020
|
|
|
2018
2021
|
//// validate account_profile_id
|
|
2019
|
-
let account_profile_ret = await db_module.get_app_couch_doc(account_doc.account_project_id, account_doc.account_profile_id);
|
|
2020
2022
|
|
|
2021
2023
|
if (!account_doc.account_profile_id) {
|
|
2022
2024
|
const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
|
|
2023
2025
|
account_doc.account_profile_id = account_profile_ret.data.id;
|
|
2024
2026
|
account_doc.account_info.active_account_profile_id = account_doc.account_profile_id;
|
|
2027
|
+
} else {
|
|
2028
|
+
let account_profile_ret = await db_module.get_app_couch_doc(account_doc.account_project_id, account_doc.account_profile_id);
|
|
2029
|
+
if (account_profile_ret.code < 0) {
|
|
2030
|
+
const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
|
|
2031
|
+
account_doc.account_profile_id = account_profile_ret.data.id;
|
|
2032
|
+
account_doc.account_info.active_account_profile_id = account_doc.account_profile_id;
|
|
2033
|
+
}
|
|
2025
2034
|
}
|
|
2026
2035
|
account_doc.boarded_info = { headers, date_ts: Date.now() };
|
|
2027
2036
|
account_doc.isBoarded = true;
|