spice-js 2.6.11 → 2.6.12
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/build/models/SpiceModel.js +11 -0
- package/package.json +1 -1
- package/src/models/SpiceModel.js +12 -1
|
@@ -846,12 +846,23 @@ class SpiceModel {
|
|
|
846
846
|
return data;
|
|
847
847
|
}
|
|
848
848
|
|
|
849
|
+
function prepColumns(columns) {
|
|
850
|
+
if (columns && columns != "") {
|
|
851
|
+
var columnList = columns.split(","); // Convert comma-separated string to array
|
|
852
|
+
|
|
853
|
+
return _.join(_.map(columnList, column => "`" + column + "`"), ",");
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
return columns;
|
|
857
|
+
}
|
|
858
|
+
|
|
849
859
|
try {
|
|
850
860
|
if (!args) {
|
|
851
861
|
args = {};
|
|
852
862
|
}
|
|
853
863
|
|
|
854
864
|
var query = "";
|
|
865
|
+
args.columns = prepColumns(args.columns);
|
|
855
866
|
|
|
856
867
|
if (args.is_full_text && args.is_full_text === "true" || args.is_custom_query && args.is_custom_query === "true") {
|
|
857
868
|
query = args.query;
|
package/package.json
CHANGED
package/src/models/SpiceModel.js
CHANGED
|
@@ -748,13 +748,24 @@ export default class SpiceModel {
|
|
|
748
748
|
}
|
|
749
749
|
return data;
|
|
750
750
|
}
|
|
751
|
+
|
|
752
|
+
function prepColumns(columns) {
|
|
753
|
+
if (columns && columns != "") {
|
|
754
|
+
let columnList = columns.split(","); // Convert comma-separated string to array
|
|
755
|
+
return _.join(
|
|
756
|
+
_.map(columnList, (column) => `\`${column}\``),
|
|
757
|
+
","
|
|
758
|
+
);
|
|
759
|
+
}
|
|
760
|
+
return columns;
|
|
761
|
+
}
|
|
751
762
|
try {
|
|
752
763
|
if (!args) {
|
|
753
764
|
args = {};
|
|
754
765
|
}
|
|
755
766
|
|
|
756
767
|
let query = "";
|
|
757
|
-
|
|
768
|
+
args.columns = prepColumns(args.columns);
|
|
758
769
|
if (
|
|
759
770
|
(args.is_full_text && args.is_full_text === "true") ||
|
|
760
771
|
(args.is_custom_query && args.is_custom_query === "true")
|