@xuda.io/account_module 1.2.1307 → 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.
Files changed (2) hide show
  1. package/index.mjs +10 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2014,10 +2014,20 @@ export const onboarding_completed = async function (req, job_id, headers) {
2014
2014
  if (!account_doc.ai_workspace_plan) {
2015
2015
  account_doc.ai_workspace_plan = 'free_ai_workspace';
2016
2016
  }
2017
+
2018
+ //// validate account_profile_id
2019
+
2017
2020
  if (!account_doc.account_profile_id) {
2018
2021
  const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
2019
2022
  account_doc.account_profile_id = account_profile_ret.data.id;
2020
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
+ }
2021
2031
  }
2022
2032
  account_doc.boarded_info = { headers, date_ts: Date.now() };
2023
2033
  account_doc.isBoarded = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1307",
3
+ "version": "1.2.1309",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {