This commit is contained in:
@@ -247,17 +247,15 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "ListKey");
|
||||
|
||||
|
||||
List<ObjectField> ListValidFilterOptions = null;
|
||||
List<ObjectField> FieldList = null;
|
||||
if (!ObjectFields.IsValidObjectKey(inObj.ListKey))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "ListKey", $"ListKey \"{inObj.ListKey}\" is empty or in-valid");
|
||||
}
|
||||
else
|
||||
{
|
||||
ListValidFilterOptions = ObjectFields.ObjectFieldsList(inObj.ListKey);
|
||||
FieldList = ObjectFields.ObjectFieldsList(inObj.ListKey);
|
||||
}
|
||||
// FilterOptions ListValidFilterOptions = FilterOptionsFromObjectKey.Get(inObj.ListKey);
|
||||
// if (ListValidFilterOptions == null)
|
||||
|
||||
|
||||
if (inObj.ListKey.Length > 255)
|
||||
@@ -281,20 +279,10 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Filter", $"Filter array item {i}, \"fld\" property is empty and required");
|
||||
|
||||
//validate the field name if we can
|
||||
if (ListValidFilterOptions != null)
|
||||
if (FieldList != null)
|
||||
{
|
||||
|
||||
// if (!ListValidFilterOptions.Flds.Exists(x => x.Fld == fld))
|
||||
// {
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Filter", $"Filter array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified");
|
||||
// }
|
||||
|
||||
// if (!ListValidFilterOptions.Exists(x => x.PropertyName.ToLowerInvariant() == fld && x.Filterable))
|
||||
// {
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Filter", $"Filter array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified");
|
||||
// }
|
||||
|
||||
var TheField = ListValidFilterOptions.SingleOrDefault(x => x.PropertyName.ToLowerInvariant() == fld);
|
||||
var TheField = FieldList.SingleOrDefault(x => x.PropertyName.ToLowerInvariant() == fld);
|
||||
|
||||
if (TheField == null)
|
||||
{
|
||||
@@ -360,10 +348,10 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Sort", $"Sort array item {i}, \"fld\" property is empty and required");
|
||||
|
||||
//validate the field name if we can
|
||||
if (ListValidFilterOptions != null)
|
||||
if (FieldList != null)
|
||||
{
|
||||
|
||||
if (!ListValidFilterOptions.Exists(x => x.PropertyName.ToLowerInvariant() == fld && x.Filterable))
|
||||
if (!FieldList.Exists(x => x.PropertyName.ToLowerInvariant() == fld && x.Filterable))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Sort", $"Sort array item {i}, fld property value \"{fld}\" is not a valid value for ListKey specified");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user