Merge pull request #283 from hargata/Hargata/calendar.view

fixed bug for records with deleted views.
This commit is contained in:
Hargata Softworks 2024-02-13 16:17:12 -07:00 committed by GitHub
commit 92b9c6953c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -176,8 +176,12 @@ namespace CarCareTracker.Helper
var fieldNames = templateExtraFields.Select(x => x.Name);
//remove fields that are no longer present in template.
recordExtraFields.RemoveAll(x => !fieldNames.Contains(x.Name));
if (!recordExtraFields.Any())
{
return templateExtraFields;
}
//append the fields.
foreach(ExtraField extraField in recordExtraFields)
foreach (ExtraField extraField in recordExtraFields)
{
extraField.IsRequired = templateExtraFields.Where(x => x.Name == extraField.Name).First().IsRequired;
}