This commit is contained in:
2020-01-15 18:52:18 +00:00
parent 8c574152e8
commit de08030b37
6 changed files with 39 additions and 22 deletions

View File

@@ -13,16 +13,6 @@ namespace AyaNova.Biz
// - Text
// - Bool
// public const string Currency = "currency";
// public const string Date = "date";
// public const string Time = "time";
// public const string DateTime = "datetime";
// public const string Text = "text";
// public const string Number = "number"; //decimal regardless
// public const string Bool = "bool";
public static List<int> ValidCustomFieldTypes
{
get
@@ -31,10 +21,11 @@ namespace AyaNova.Biz
ret.Add((int)AyaDataType.Currency);
ret.Add((int)AyaDataType.Date);
ret.Add((int)AyaDataType.Time);
ret.Add((int)AyaDataType.DateTime);
ret.Add((int)AyaDataType.DateTime);
ret.Add((int)AyaDataType.Text);
ret.Add((int)AyaDataType.Number);
ret.Add((int)AyaDataType.Bool);
ret.Add((int)AyaDataType.Decimal);
ret.Add((int)AyaDataType.Integer);
ret.Add((int)AyaDataType.Bool);
return ret;
}
}

View File

@@ -258,7 +258,7 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value is not valid, only Custom fields can have types specified");
else
{//It is a custom field, is it a valid type value
var templateFieldCustomTypeValue = formFieldItem["type"].Value<string>();
var templateFieldCustomTypeValue = formFieldItem["type"].Value<int>();
if (!ValidCustomFieldTypes.Contains(templateFieldCustomTypeValue))
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Template", $"Template array item {i}, \"type\" property value of \"{templateFieldCustomTypeValue}\" is not a valid custom field type");
}