@xuda.io/ai_module 1.1.3926 → 1.1.3927

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.
Files changed (2) hide show
  1. package/index.mjs +11 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2797,7 +2797,17 @@ export const get_apps = async function (req, job_id, headers) {
2797
2797
 
2798
2798
  let user_apps = { docs: [], total_docs: 0 };
2799
2799
  if (filter_type !== 'pending') {
2800
- user_apps = await db_module.find_app_couch_query(app_id, opt);
2800
+ if (!limit || conversation_id) {
2801
+ user_apps = await db_module.find_app_couch_query(app_id, opt);
2802
+ } else {
2803
+ delete opt.sort;
2804
+ delete opt.skip;
2805
+ opt.limit = 9999;
2806
+ opt.fields = ['_id'];
2807
+
2808
+ const counter = await db_module.find_app_couch_query(app_id, opt);
2809
+ ai_chats.total_docs = counter.docs.length;
2810
+ }
2801
2811
  }
2802
2812
 
2803
2813
  ///////////////
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3926",
3
+ "version": "1.1.3927",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",