@xuda.io/ai_module 1.1.3680 → 1.1.3682
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 +9 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1865,10 +1865,18 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1865
1865
|
if (filter_type !== 'pending') {
|
|
1866
1866
|
ai_chats = await db_module.find_app_couch_query(app_id, opt);
|
|
1867
1867
|
}
|
|
1868
|
-
console.log('opt', opt, ai_chats);
|
|
1868
|
+
// console.log('opt', opt, ai_chats);
|
|
1869
1869
|
let docs = [];
|
|
1870
1870
|
|
|
1871
1871
|
for (let doc of ai_chats.docs || []) {
|
|
1872
|
+
let reference_doc;
|
|
1873
|
+
|
|
1874
|
+
if (doc.shared_from_uid) {
|
|
1875
|
+
reference_doc = _.cloneDeep(doc);
|
|
1876
|
+
doc = reference_doc;
|
|
1877
|
+
doc.reference_doc = reference_doc;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1872
1880
|
doc.notifications = 0;
|
|
1873
1881
|
doc.interactions = doc?.messages?.length || 0;
|
|
1874
1882
|
for (let msg of doc.messages) {
|