This commit is contained in:
Tben
2023-08-29 08:27:30 +01:00
parent 9c61e83166
commit 70ee0a2c0a
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ async function addDbEntry({ dbFullName, tableName, data, tableSchema, duplicateC
if (targetFieldSchema?.pattern) {
const pattern = new RegExp(targetFieldSchema.pattern, targetFieldSchema.patternFlags || "");
if (!pattern.test(value)) {
if (!value?.toString()?.match(pattern)) {
console.log("DSQL: Pattern not matched =>", value);
value = "";
}
+1 -1
View File
@@ -83,7 +83,7 @@ async function updateDbEntry({ dbContext, paradigm, dbFullName, tableName, data,
if (targetFieldSchema?.pattern) {
const pattern = new RegExp(targetFieldSchema.pattern, targetFieldSchema.patternFlags || "");
if (!pattern.test(value)) {
if (!value?.toString()?.match(pattern)) {
console.log("DSQL: Pattern not matched =>", value);
value = "";
}