@optimiser/common 1.0.381 → 1.0.382
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/dist/lib/utility.js +8 -22
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -1860,7 +1860,7 @@ function CheckDataBeforeAdd(updateObj, objectSchema, db) {
|
|
|
1860
1860
|
switch (_c.label) {
|
|
1861
1861
|
case 0:
|
|
1862
1862
|
fieldSchema = objectSchema.Fields.find(function (x) { return x.Name == fldName; });
|
|
1863
|
-
if (!fieldSchema) return [3 /*break*/,
|
|
1863
|
+
if (!fieldSchema) return [3 /*break*/, 7];
|
|
1864
1864
|
cityfield = void 0;
|
|
1865
1865
|
if (fieldSchema.LookupObject == "City") {
|
|
1866
1866
|
cityfield = updateObj[fldName];
|
|
@@ -1901,14 +1901,7 @@ function CheckDataBeforeAdd(updateObj, objectSchema, db) {
|
|
|
1901
1901
|
if (fieldSchema.UIDataType == 'formula')
|
|
1902
1902
|
delete updateObj[fldName];
|
|
1903
1903
|
_c.label = 7;
|
|
1904
|
-
case 7:
|
|
1905
|
-
// QPC-9020 for State and Country Field Server Side Validation
|
|
1906
|
-
return [4 /*yield*/, ValidateStateCountryField(fieldSchema, updateObj, fldName, objectSchema, db, cityfield)];
|
|
1907
|
-
case 8:
|
|
1908
|
-
// QPC-9020 for State and Country Field Server Side Validation
|
|
1909
|
-
_c.sent();
|
|
1910
|
-
_c.label = 9;
|
|
1911
|
-
case 9: return [2 /*return*/];
|
|
1904
|
+
case 7: return [2 /*return*/];
|
|
1912
1905
|
}
|
|
1913
1906
|
});
|
|
1914
1907
|
};
|
|
@@ -1944,10 +1937,10 @@ function CheckDataBeforeUpdate(updateObj, objectData, objectSchema, db) {
|
|
|
1944
1937
|
case 0:
|
|
1945
1938
|
if (!(fldName == '_id')) return [3 /*break*/, 1];
|
|
1946
1939
|
delete updateObj[fldName];
|
|
1947
|
-
return [3 /*break*/,
|
|
1940
|
+
return [3 /*break*/, 5];
|
|
1948
1941
|
case 1:
|
|
1949
1942
|
fieldSchema = objectSchema.Fields.find(function (x) { return x.Name == fldName; });
|
|
1950
|
-
if (!fieldSchema) return [3 /*break*/,
|
|
1943
|
+
if (!fieldSchema) return [3 /*break*/, 5];
|
|
1951
1944
|
cityfield = void 0;
|
|
1952
1945
|
if (fieldSchema.LookupObject == "City") {
|
|
1953
1946
|
cityfield = updateObj[fldName];
|
|
@@ -1975,14 +1968,7 @@ function CheckDataBeforeUpdate(updateObj, objectData, objectSchema, db) {
|
|
|
1975
1968
|
case 4:
|
|
1976
1969
|
_c.sent();
|
|
1977
1970
|
_c.label = 5;
|
|
1978
|
-
case 5:
|
|
1979
|
-
// QPC-9020 for State and Country Field Server Side Validation
|
|
1980
|
-
return [4 /*yield*/, ValidateStateCountryField(fieldSchema, updateObj, fldName, objectSchema, db, cityfield)];
|
|
1981
|
-
case 6:
|
|
1982
|
-
// QPC-9020 for State and Country Field Server Side Validation
|
|
1983
|
-
_c.sent();
|
|
1984
|
-
_c.label = 7;
|
|
1985
|
-
case 7: return [2 /*return*/];
|
|
1971
|
+
case 5: return [2 /*return*/];
|
|
1986
1972
|
}
|
|
1987
1973
|
});
|
|
1988
1974
|
};
|
|
@@ -4803,13 +4789,13 @@ function ValidateUserInput(options) {
|
|
|
4803
4789
|
}
|
|
4804
4790
|
field = schemaFields.find(function (x) { return x.Name == fieldName; });
|
|
4805
4791
|
if (!field) return [3 /*break*/, 58];
|
|
4806
|
-
if (field.DisableValidateUserInput) {
|
|
4807
|
-
return [2 /*return*/, "continue"];
|
|
4808
|
-
}
|
|
4809
4792
|
if (IsStringValue(fieldData)) { //sanitizing Html
|
|
4810
4793
|
inputFields[fieldName] = (0, sanitize_html_1.default)(fieldData);
|
|
4811
4794
|
fieldData = inputFields[fieldName];
|
|
4812
4795
|
}
|
|
4796
|
+
if (field.DisableValidateUserInput) {
|
|
4797
|
+
return [2 /*return*/, "continue"];
|
|
4798
|
+
}
|
|
4813
4799
|
if ((field.UIDataType == 'date' || field.UIDataType == 'datetime') && IsStringValue(fieldData) && fieldData.trim() == '') {
|
|
4814
4800
|
inputFields[fieldName] = null;
|
|
4815
4801
|
}
|