@xuda.io/ai_module 1.1.3584 → 1.1.3586
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 -15
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1873,12 +1873,13 @@ 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
|
|
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
|
-
const data = await
|
|
1882
|
+
const data = await db_module.save_app_couch_doc(app_id, conversation_doc);
|
|
1882
1883
|
|
|
1883
1884
|
client.conversations.delete(conversation_id);
|
|
1884
1885
|
|
|
@@ -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) {
|