@xuda.io/ai_module 1.1.4619 → 1.1.4621

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 +7 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1802,9 +1802,15 @@ export const get_ai_chats = async function (req, job_id, headers) {
1802
1802
  },
1803
1803
  limit: limit || 9999,
1804
1804
  skip: skip || 0,
1805
- sort: [{ ts: reference_id ? 'asc' : 'desc' }],
1805
+ // sort: [{ ts: reference_id ? 'asc' : 'desc' }],
1806
1806
  };
1807
1807
 
1808
+ if (reference_id) {
1809
+ opt.sort = [{ date_created_ts: 'asc' }];
1810
+ } else {
1811
+ opt.sort = [{ ts: 'desc' }];
1812
+ }
1813
+
1808
1814
  if (!account_profile_info.is_main) {
1809
1815
  opt.selector.account_profiles = { $in: [account_profile_info.account_profile_id] };
1810
1816
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4619",
3
+ "version": "1.1.4621",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",