CTLE-507 Update to sort fields AFTER adding removed ones

This commit is contained in:
2023-07-06 15:57:38 -05:00
parent be5b8f0869
commit 6f578eb2f0

View File

@ -73,7 +73,6 @@ public class GetTableApiFieldsAction extends AbstractQActionFunction<GetTableApi
// get fields on the table which are in this version // // get fields on the table which are in this version //
/////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
List<QFieldMetaData> fieldList = new ArrayList<>(table.getFields().values()); List<QFieldMetaData> fieldList = new ArrayList<>(table.getFields().values());
fieldList.sort(Comparator.comparing(QFieldMetaData::getLabel));
for(QFieldMetaData field : fieldList) for(QFieldMetaData field : fieldList)
{ {
if(!isExcluded(input.getApiName(), field) && getApiVersionRange(input.getApiName(), field).includes(version)) if(!isExcluded(input.getApiName(), field) && getApiVersionRange(input.getApiName(), field).includes(version))
@ -93,6 +92,8 @@ public class GetTableApiFieldsAction extends AbstractQActionFunction<GetTableApi
} }
} }
fieldList.sort(Comparator.comparing(QFieldMetaData::getLabel));
return (new GetTableApiFieldsOutput().withFields(fields)); return (new GetTableApiFieldsOutput().withFields(fields));
} }