@xuda.io/account_module 1.2.1301 → 1.2.1302
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 +4 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2833,7 +2833,8 @@ export const archive_account_profile = async function (req) {
|
|
|
2833
2833
|
export const delete_account_profile = async function (req, job_id, headers) {
|
|
2834
2834
|
const { profile_id } = req;
|
|
2835
2835
|
try {
|
|
2836
|
-
|
|
2836
|
+
const app_id = await get_account_default_project_id(uid);
|
|
2837
|
+
var account_profile_doc = await db_module.get_app_couch_doc_native(app_id, profile_id);
|
|
2837
2838
|
if (account_profile_doc.stat !== 5) {
|
|
2838
2839
|
throw new Error('A document can only be deleted after it has been archived');
|
|
2839
2840
|
}
|
|
@@ -2841,7 +2842,7 @@ export const delete_account_profile = async function (req, job_id, headers) {
|
|
|
2841
2842
|
account_profile_doc.stat_ts = Date.now();
|
|
2842
2843
|
account_profile_doc.stat_reason = 'deleted by the user';
|
|
2843
2844
|
|
|
2844
|
-
const account_profile_save_ret = await db_module.
|
|
2845
|
+
const account_profile_save_ret = await db_module.save_app_couch_doc(app_id, account_profile_doc);
|
|
2845
2846
|
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
2846
2847
|
ai_module.delete_depended_chats(uid, profile_id);
|
|
2847
2848
|
return account_profile_save_ret;
|
|
@@ -2857,7 +2858,7 @@ export const unarchive_account_profile = async function (req) {
|
|
|
2857
2858
|
const { profile_id } = req;
|
|
2858
2859
|
try {
|
|
2859
2860
|
const app_id = await get_account_default_project_id(uid);
|
|
2860
|
-
const team_module = await import(`${module_path}/team_module/index.mjs`);
|
|
2861
|
+
// const team_module = await import(`${module_path}/team_module/index.mjs`);
|
|
2861
2862
|
var account_profile_doc = await db_module.get_app_couch_doc_native(app_id, profile_id);
|
|
2862
2863
|
|
|
2863
2864
|
if (account_profile_doc.stat !== 5) {
|