@xuda.io/ai_module 1.1.3706 → 1.1.3707

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 +11 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2608,10 +2608,17 @@ export const delete_mini_app = async function (req) {
2608
2608
  const app_id = await account_module.get_account_default_project_id(uid);
2609
2609
  try {
2610
2610
  let prog_doc = await db_module.get_app_couch_doc_native(app_id, prog_id);
2611
- prog_doc.stat = 4;
2612
- prog_doc.ts = Date.now();
2613
- const save_ret = await db_module.save_app_couch_doc(app_id, prog_doc);
2614
- delete_depended_chats(uid, prog_id);
2611
+ let save_ret;
2612
+ if (conversation_doc.shared_from_uid) {
2613
+ // delete the share , the doc will delete by the remove_team_member
2614
+ const team_module = await import(`${module_path}/team_module/index.mjs`);
2615
+ save_ret = await team_module.remove_team_member({ team_req_id: conversation_doc.team_req_id });
2616
+ } else {
2617
+ prog_doc.stat = 4;
2618
+ prog_doc.ts = Date.now();
2619
+ save_ret = await db_module.save_app_couch_doc(app_id, prog_doc);
2620
+ delete_depended_chats(uid, prog_id);
2621
+ }
2615
2622
  return save_ret;
2616
2623
  } catch (err) {
2617
2624
  return { code: -9, data: err.message };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3706",
3
+ "version": "1.1.3707",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",