Skip to content

Commit ff2395f

Browse files
committed
TD-3885 Handling Deleted Group Filter Issue
1 parent 8ad6736 commit ff2395f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

DigitalLearningSolutions.Web/Controllers/TrackingSystem/Delegates/AllDelegatesController.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,14 @@ public IActionResult Index(
163163
jobGroupId = Convert.ToInt32(filterValue);
164164

165165
if (filter.Contains("DelegateGroupId"))
166+
{
166167
groupId = Convert.ToInt32(filterValue);
168+
if (!(groups.Any(g => g.Item1 == groupId)))
169+
{
170+
groupId = null;
171+
existingFilterString = FilterHelper.RemoveNonExistingFilterOptions(availableFilters, existingFilterString);
172+
}
173+
}
167174

168175
if (filter.Contains("Answer1"))
169176
answer1 = filterValue;
@@ -217,7 +224,7 @@ public IActionResult Index(
217224
customPrompts,
218225
availableFilters
219226
);
220-
227+
221228
model.TotalPages = (int)(resultCount / itemsPerPage) + ((resultCount % itemsPerPage) > 0 ? 1 : 0);
222229
model.MatchingSearchResults = resultCount;
223230

0 commit comments

Comments
 (0)