This commit is contained in:
2020-01-20 18:43:02 +00:00
parent 7d92f15439
commit af99720eda
3 changed files with 13 additions and 16 deletions

View File

@@ -281,14 +281,12 @@ namespace AyaNova.Biz
//Accept a json template
//return a column list suitable for api list return
public static string GenerateListColumnsJSONFromTemplate(AyaType defaultLinkType, string ObjectKey, string template)
public static string GenerateListColumnsJSONFromTemplate(AyaType defaultLinkType, List<AyaObjectFieldDefinition> objectFields, string template)
{
//parse the template
var jtemplate = JObject.Parse(template);
//get the fields list
var fields = AyaObjectFields(ObjectKey);
//convert to strings (https://stackoverflow.com/a/33836599/8939)
var fullFields = ((JArray)jtemplate["full"]).ToObject<string[]>();
@@ -301,7 +299,7 @@ namespace AyaNova.Biz
foreach (string s in fullFields)
{
AyaObjectFieldDefinition o = fields.FirstOrDefault(x => x.FieldKey == s);
AyaObjectFieldDefinition o = objectFields.FirstOrDefault(x => x.FieldKey == s);
#if (DEBUG)
//Developers little helper
if (o == null)