@xuda.io/ai_module 1.1.4221 → 1.1.4223
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 +3 -12
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4451,16 +4451,8 @@ const chat_note = async function (req, job_id, headers) {
|
|
|
4451
4451
|
const { uid } = req;
|
|
4452
4452
|
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
4453
4453
|
let { prompt, conversation_doc, attachments = [], ai_agents } = req;
|
|
4454
|
-
// const { account_profile_info } = conversation_doc;
|
|
4455
|
-
const conversation_id = conversation_doc._id;
|
|
4456
|
-
|
|
4457
|
-
// const receiver_contact_doc = await account_module.get_contact_info(uid, null, conversation_doc.reference_id);
|
|
4458
|
-
// const receiver_app_id = await account_module.get_account_default_project_id(receiver_contact_doc.contact_uid);
|
|
4459
|
-
// let receiver_conversation_doc = await db_module.get_app_couch_doc_native(receiver_app_id, conversation_id);
|
|
4460
|
-
|
|
4461
|
-
// let sender_contact_doc = await account_module.get_contact_info(uid, null, conversation_doc.reference_id);
|
|
4462
4454
|
|
|
4463
|
-
|
|
4455
|
+
const conversation_id = conversation_doc._id;
|
|
4464
4456
|
|
|
4465
4457
|
const sender_app_id = account_profile_info.app_id; //await account_module.get_account_default_project_id(uid);
|
|
4466
4458
|
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
@@ -4478,9 +4470,8 @@ const chat_note = async function (req, job_id, headers) {
|
|
|
4478
4470
|
});
|
|
4479
4471
|
|
|
4480
4472
|
const obj = { id: item.data[0].id, ts: Date.now(), uid, read: true, conversation_type: 'note' };
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
sender_conversation_doc.messages.push({ ...obj, ...{ read: false } });
|
|
4473
|
+
|
|
4474
|
+
sender_conversation_doc.messages.push({ ...obj, ...{ read: true } });
|
|
4484
4475
|
await db_module.save_app_couch_doc_native(sender_app_id, sender_conversation_doc);
|
|
4485
4476
|
|
|
4486
4477
|
return { code: 15, data: item };
|