@xuda.io/account_module 1.2.1306 → 1.2.1308

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 +6 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2014,6 +2014,10 @@ 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
+ let account_profile_ret = await db_module.get_app_couch_doc(account_doc.account_project_id, account_doc.account_profile_id);
2020
+
2017
2021
  if (!account_doc.account_profile_id) {
2018
2022
  const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
2019
2023
  account_doc.account_profile_id = account_profile_ret.data.id;
@@ -2760,7 +2764,7 @@ export const get_account_profiles = async function (req) {
2760
2764
  let profiles = { docs: [], total_docs: 0 };
2761
2765
 
2762
2766
  if (filter_type !== 'pending') {
2763
- profiles = await db_module.find_couch_query('xuda_accounts', opt);
2767
+ profiles = await db_module.find_app_couch_query(app_id, opt);
2764
2768
  if (!limit || profile_id) {
2765
2769
  profiles.total_docs = profiles.docs.length;
2766
2770
  } else {
@@ -2769,7 +2773,7 @@ export const get_account_profiles = async function (req) {
2769
2773
  opt.limit = 9999;
2770
2774
  opt.fields = ['_id'];
2771
2775
 
2772
- const counter = await db_module.find_couch_query('xuda_accounts', opt);
2776
+ const counter = await db_module.find_app_couch_query(app_id, opt);
2773
2777
  profiles.total_docs = counter.docs.length;
2774
2778
  }
2775
2779
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1306",
3
+ "version": "1.2.1308",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {