@xuda.io/ai_module 1.1.3584 → 1.1.3585

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 +3 -14
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1873,9 +1873,10 @@ export const get_ai_chats = async function (req, job_id, headers) {
1873
1873
  export const delete_ai_chat = async function (req) {
1874
1874
  let { conversation_id, uid } = req;
1875
1875
 
1876
- const project_db = await get_account_project_db(uid);
1876
+ // const project_db = await get_account_project_db(uid);
1877
+ const app_id = await account_module.get_account_default_project_id(uid);
1877
1878
  try {
1878
- let conversation_doc = await project_db.get(conversation_id);
1879
+ let conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
1879
1880
  conversation_doc.stat = 4;
1880
1881
  conversation_doc.ts = Date.now();
1881
1882
  const data = await project_db.insert(conversation_doc);
@@ -1897,18 +1898,6 @@ export const delete_ai_chat = async function (req) {
1897
1898
  } catch (err) {
1898
1899
  return { code: -3, data: err.message };
1899
1900
  }
1900
-
1901
- // const db = get_xuda_couch('xuda_contacts');
1902
- // try {
1903
- // let conversation_doc = await db.get(conversation_id);
1904
- // conversation_doc.stat = 4;
1905
- // conversation_doc.ts = Date.now();
1906
- // const data = await db.insert(conversation_doc);
1907
-
1908
- // return { code: 1, data };
1909
- // } catch (err) {
1910
- // return { code: -1, data: err.message };
1911
- // }
1912
1901
  };
1913
1902
 
1914
1903
  export const create_studio_app = async function (subject) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3584",
3
+ "version": "1.1.3585",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",