@xuda.io/account_module 1.2.1308 → 1.2.1309
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 +7 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2016,12 +2016,18 @@ export const onboarding_completed = async function (req, job_id, headers) {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
|
|
2018
2018
|
//// 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
2019
|
|
|
2021
2020
|
if (!account_doc.account_profile_id) {
|
|
2022
2021
|
const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
|
|
2023
2022
|
account_doc.account_profile_id = account_profile_ret.data.id;
|
|
2024
2023
|
account_doc.account_info.active_account_profile_id = account_doc.account_profile_id;
|
|
2024
|
+
} else {
|
|
2025
|
+
let account_profile_ret = await db_module.get_app_couch_doc(account_doc.account_project_id, account_doc.account_profile_id);
|
|
2026
|
+
if (account_profile_ret.code < 0) {
|
|
2027
|
+
const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
|
|
2028
|
+
account_doc.account_profile_id = account_profile_ret.data.id;
|
|
2029
|
+
account_doc.account_info.active_account_profile_id = account_doc.account_profile_id;
|
|
2030
|
+
}
|
|
2025
2031
|
}
|
|
2026
2032
|
account_doc.boarded_info = { headers, date_ts: Date.now() };
|
|
2027
2033
|
account_doc.isBoarded = true;
|