@xuda.io/xuda-dbs-plugin-xuda 1.0.12 → 1.0.13
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 +13 -10
- package/package.json +1 -1
package/index.mjs
CHANGED
@@ -509,11 +509,13 @@ export const Read = async (_, e, db, table_obj) => {
|
|
509
509
|
|
510
510
|
if (e.sort_fields && JSON.parse(e.sort_fields).length) {
|
511
511
|
opt.sort = JSON.parse(e.sort_fields);
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
[
|
516
|
-
|
512
|
+
if (opt.sort) {
|
513
|
+
for await (const [key, val] of Object.entries(opt.sort)) {
|
514
|
+
var field_name = val.colId;
|
515
|
+
opt.sort[key] = {
|
516
|
+
["udfData.data." + field_name]: val.sort,
|
517
|
+
};
|
518
|
+
}
|
517
519
|
}
|
518
520
|
}
|
519
521
|
|
@@ -721,11 +723,12 @@ export const Read = async (_, e, db, table_obj) => {
|
|
721
723
|
}
|
722
724
|
if (!e.sort_fields || !JSON.parse(e.sort_fields).length) {
|
723
725
|
// added 2021 09 10
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
726
|
+
if (opt.sort) {
|
727
|
+
for await (const [key, val] of Object.entries(opt.sort)) {
|
728
|
+
opt.sort[key] = {
|
729
|
+
["udfData.data." + val]: e.sortOrder === "des" ? "desc" : "asc",
|
730
|
+
};
|
731
|
+
}
|
729
732
|
}
|
730
733
|
}
|
731
734
|
|
package/package.json
CHANGED