@xuda.io/ai_module 1.1.3679 → 1.1.3681
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 +8 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1865,10 +1865,17 @@ 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);
|
|
1868
|
+
// console.log('opt', opt, ai_chats);
|
|
1869
1869
|
let docs = [];
|
|
1870
1870
|
|
|
1871
1871
|
for (let doc of ai_chats.docs || []) {
|
|
1872
|
+
let source_doc;
|
|
1873
|
+
|
|
1874
|
+
if (doc.shared_from_uid) {
|
|
1875
|
+
source_doc = _.cloneDeep(doc);
|
|
1876
|
+
doc = source_doc;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1872
1879
|
doc.notifications = 0;
|
|
1873
1880
|
doc.interactions = doc?.messages?.length || 0;
|
|
1874
1881
|
for (let msg of doc.messages) {
|