@xuda.io/xuda-dbs-plugin-xuda 1.0.88 → 1.0.90

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/package.json +1 -1
  2. package/server.js +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-dbs-plugin-xuda",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
4
4
  "description": "Xuda Database Socket for Xuda's proprietary structure powered by CouchDB",
5
5
  "scripts": {
6
6
  "pub": "npm version patch --force && npm publish --access public"
package/server.js CHANGED
@@ -670,7 +670,7 @@ const query_db = async function (e, db, app_id_reference, table_obj) {
670
670
  for (const [key, val] of Object.entries(opt.fields)) {
671
671
  opt.fields[key] = "udfData.data." + val;
672
672
  }
673
- if (!e.sort_fields || !JSON.parse(e.sort_fields).length) {
673
+ if (!e?.sort_fields?.length) {
674
674
  // added 2021 09 10
675
675
  if (opt.sort) {
676
676
  for (const [key, val] of Object.entries(opt.sort)) {
@@ -680,6 +680,16 @@ const query_db = async function (e, db, app_id_reference, table_obj) {
680
680
  }
681
681
  }
682
682
  }
683
+ // if (!e.sort_fields || !JSON.parse(e.sort_fields).length) {
684
+ // // added 2021 09 10
685
+ // if (opt.sort) {
686
+ // for (const [key, val] of Object.entries(opt.sort)) {
687
+ // opt.sort[key] = {
688
+ // ["udfData.data." + val]: e.sortOrder === "des" ? "desc" : "asc",
689
+ // };
690
+ // }
691
+ // }
692
+ // }
683
693
 
684
694
  var selector_new = {};
685
695