Updates
This commit is contained in:
@@ -2,6 +2,7 @@ import sanitizeHtml from "sanitize-html";
|
||||
import sanitizeHtmlOptions from "../html/sanitizeHtmlOptions";
|
||||
import encrypt from "../../dsql/encrypt";
|
||||
import { DSQL_TableSchemaType } from "../../../types";
|
||||
import numberfy from "../../../utils/numberfy";
|
||||
import _ from "lodash";
|
||||
|
||||
type Param = {
|
||||
@@ -57,6 +58,13 @@ export default function grabParsedValue({
|
||||
newValue = "";
|
||||
}
|
||||
|
||||
if (
|
||||
targetFieldSchema?.dataType?.match(/int$|decimal|float|double/i) &&
|
||||
typeof value == "string"
|
||||
) {
|
||||
newValue = numberfy(value);
|
||||
}
|
||||
|
||||
if (targetFieldSchema?.encrypted) {
|
||||
newValue =
|
||||
encrypt({
|
||||
|
||||
@@ -359,12 +359,18 @@ export default function sqlGenerator<
|
||||
return genSqlSrchStr({ queryObj, field, join: genObject?.join });
|
||||
});
|
||||
|
||||
const cleanedUpSearchStr = sqlSearhString?.filter(
|
||||
(str) => typeof str == "string"
|
||||
);
|
||||
|
||||
const isSearchStr =
|
||||
sqlSearhString?.[0] && sqlSearhString.find((str) => str);
|
||||
cleanedUpSearchStr?.[0] && cleanedUpSearchStr.find((str) => str);
|
||||
|
||||
if (isSearchStr) {
|
||||
const stringOperator = genObject?.searchOperator || "AND";
|
||||
queryString += ` WHERE ${sqlSearhString.join(` ${stringOperator} `)}`;
|
||||
queryString += ` WHERE ${cleanedUpSearchStr.join(
|
||||
` ${stringOperator} `
|
||||
)}`;
|
||||
}
|
||||
|
||||
if (genObject?.fullTextSearch && fullTextSearchStr && fullTextMatchStr) {
|
||||
|
||||
Reference in New Issue
Block a user