@xuda.io/ai_module 1.1.3553 → 1.1.3555
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 +4 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1760,6 +1760,7 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1760
1760
|
},
|
|
1761
1761
|
limit: limit || 9999,
|
|
1762
1762
|
skip: skip || 0,
|
|
1763
|
+
sort: ['ts'],
|
|
1763
1764
|
};
|
|
1764
1765
|
|
|
1765
1766
|
switch (filter_type) {
|
|
@@ -1836,8 +1837,9 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1836
1837
|
|
|
1837
1838
|
const ai_chats = await db_module.find_app_couch_query(app_id, opt);
|
|
1838
1839
|
let docs = [];
|
|
1839
|
-
for (let row of ai_chats.rows) {
|
|
1840
|
-
|
|
1840
|
+
// for (let row of ai_chats.rows) {
|
|
1841
|
+
for (let doc of ai_chats.docs) {
|
|
1842
|
+
// let doc = row.value;
|
|
1841
1843
|
doc.notifications = 0;
|
|
1842
1844
|
doc.interactions = doc?.messages?.length || 0;
|
|
1843
1845
|
for (let msg of doc.messages) {
|