Skip to content

Commit

Permalink
Merge pull request #29 from OS2Valghalla/VALGHAL_974
Browse files Browse the repository at this point in the history
fix issue where irrelevant tasks removed when editing work location
  • Loading branch information
ramogens-OS2 authored Apr 2, 2024
2 parents 9c6f1bd + 456d8a5 commit a700924
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public async Task<Guid> CreateWorkLocationAsync(CreateWorkLocationCommand comman
var deletedWorkLocationResponsiblesIds = deletedWorkLocationResponsibles.Select(t => t.ParticipantId).ToList();
var newWorkLocationResponsibleIds = command.ResponsibleIds.Where(r => !existingWorkLocationResponsibles.Any(i => i.ParticipantId == r)).ToList();

var deletedAssociatedTasks = await tasks.Where(t => t.WorkLocationId != command.Id && (deletedWorkLocationTaskTypeIds.Contains(t.TaskTypeId) || deletedWorkLocationTeamsIds.Contains(t.TeamId))).ToListAsync();
var deletedAssociatedTasks = await tasks.Where(t => t.WorkLocationId == command.Id && (deletedWorkLocationTaskTypeIds.Contains(t.TaskTypeId) || deletedWorkLocationTeamsIds.Contains(t.TeamId))).ToListAsync(cancellationToken);

foreach (var deletedWorkLocationTaskType in deletedWorkLocationTaskTypes)
{
Expand Down

0 comments on commit a700924

Please sign in to comment.