Skip to content

Commit

Permalink
Updated the new function with department level filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
larfeq committed Nov 15, 2024
1 parent 758e2bb commit 89fe0a9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public async Task RunAsync(
// Fetch all departments
var departments = (await lineOrgApiClient.GetOrgUnitDepartmentsAsync())
.DistinctBy(d => d.SapId)
.Where(d => d.FullDepartment != null && d.SapId != null);
.Where(d => d.FullDepartment != null && d.SapId != null)
.Where(d => d.Level >= 4);

if (_departmentFilter.Length != 0)
departments = departments.Where(d => _departmentFilter.Any(df => d.FullDepartment!.Contains(df)));
Expand Down

0 comments on commit 89fe0a9

Please sign in to comment.