diff --git a/src/Fusion.Summary.Api/Controllers/DepartmentsController.cs b/src/Fusion.Summary.Api/Controllers/DepartmentsController.cs index 96f10cc7d..fc96419cc 100644 --- a/src/Fusion.Summary.Api/Controllers/DepartmentsController.cs +++ b/src/Fusion.Summary.Api/Controllers/DepartmentsController.cs @@ -126,8 +126,13 @@ public async Task PutV1(string sapDepartmentId, [FromBody] PutDep .Concat(request.DelegateResourceOwnersAzureUniqueId) .Select(p => new PersonIdentifier(p)); - if ((await ResolvePersonsAsync(personIdentifiers)).FirstOrDefault(r => !r.Success) is { } unresolvedProfile) - return BadRequest($"{unresolvedProfile.Identifier} could not be resolved"); + var unresolvedProfiles = (await ResolvePersonsAsync(personIdentifiers)) + .Where(r => !r.Success) + .ToList(); + + if (unresolvedProfiles.Count != 0) + return BadRequest($"Profiles: {string.Join(',', unresolvedProfiles)} could not be resolved"); + var department = await DispatchAsync(new GetDepartment(sapDepartmentId));