@xuda.io/ai_module 1.1.4989 → 1.1.4990
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 +10 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1326,6 +1326,16 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1326
1326
|
doc.notifications = contact_chat_conversation_count_ret - contact_chat_conversation_read_ret;
|
|
1327
1327
|
doc.chats = doc.interactions;
|
|
1328
1328
|
|
|
1329
|
+
// get conversation item
|
|
1330
|
+
let opt = {
|
|
1331
|
+
selector: {
|
|
1332
|
+
docType: 'chat_conversation_item',
|
|
1333
|
+
conversation_id: doc._id,
|
|
1334
|
+
},
|
|
1335
|
+
limit: 1,
|
|
1336
|
+
};
|
|
1337
|
+
const conversation_item = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
|
|
1338
|
+
|
|
1329
1339
|
// doc.notifications = 0;
|
|
1330
1340
|
// doc.interactions = doc?.messages?.length || 0;
|
|
1331
1341
|
// for (let msg of doc.messages) {
|