@xuda.io/ai_module 1.1.5060 → 1.1.5062
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 +5 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1340,15 +1340,16 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1340
1340
|
let conversations = {};
|
|
1341
1341
|
let docs = [];
|
|
1342
1342
|
for (let val of ret.rows || []) {
|
|
1343
|
-
// let _conversation = conversations[val.value.conversation_id];
|
|
1344
|
-
|
|
1345
1343
|
if (!conversations[val.value.conversation_id]) {
|
|
1346
1344
|
conversations[val.value.conversation_id] = {};
|
|
1347
1345
|
}
|
|
1348
|
-
|
|
1349
1346
|
conversations[val.value.conversation_id][val.value.type] = val.doc;
|
|
1350
1347
|
}
|
|
1351
1348
|
|
|
1349
|
+
for (let val of ret.rows || []) {
|
|
1350
|
+
docs.push(conversations[val.value.conversation_id]);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1352
1353
|
return ret;
|
|
1353
1354
|
};
|
|
1354
1355
|
|
|
@@ -1382,9 +1383,9 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1382
1383
|
let ai_chats = { docs: [], total_docs: 0 };
|
|
1383
1384
|
|
|
1384
1385
|
if (filter_type !== 'pending') {
|
|
1386
|
+
ai_chats = await get_data_view();
|
|
1385
1387
|
if (reference_id && reference_type === 'contacts') {
|
|
1386
1388
|
ai_chats = await get_data_view();
|
|
1387
|
-
debugger;
|
|
1388
1389
|
} else {
|
|
1389
1390
|
ai_chats = await get_data_find();
|
|
1390
1391
|
}
|