This commit is contained in:
2025-12-16 11:19:06 +01:00
parent 14ea760373
commit 0d9f313dc0
5 changed files with 27 additions and 7 deletions
@@ -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) {