@xuda.io/ai_module 1.1.5059 → 1.1.5061
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 +6 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1125,7 +1125,7 @@ export const get_chat_conversation = async function (req) {
|
|
|
1125
1125
|
};
|
|
1126
1126
|
|
|
1127
1127
|
export const get_ai_chats = async function (req, job_id, headers) {
|
|
1128
|
-
let { uid, reference_id = '', _id, search, filter_type = 'all', conversation_type, limit, skip, conversation_id, profile_id } = req;
|
|
1128
|
+
let { uid, reference_type, reference_id = '', _id, search, filter_type = 'all', conversation_type, limit, skip, conversation_id, profile_id } = req;
|
|
1129
1129
|
|
|
1130
1130
|
const account_profile_info = await get_active_account_profile_info(uid, profile_id);
|
|
1131
1131
|
|
|
@@ -1340,15 +1340,15 @@ 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
|
+
}
|
|
1351
|
+
|
|
1352
1352
|
return ret;
|
|
1353
1353
|
};
|
|
1354
1354
|
|
|
@@ -1382,9 +1382,9 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1382
1382
|
let ai_chats = { docs: [], total_docs: 0 };
|
|
1383
1383
|
|
|
1384
1384
|
if (filter_type !== 'pending') {
|
|
1385
|
-
|
|
1385
|
+
ai_chats = await get_data_view();
|
|
1386
|
+
if (reference_id && reference_type === 'contacts') {
|
|
1386
1387
|
ai_chats = await get_data_view();
|
|
1387
|
-
debugger;
|
|
1388
1388
|
} else {
|
|
1389
1389
|
ai_chats = await get_data_find();
|
|
1390
1390
|
}
|