Skip to content

Commit

Permalink
fix issue where irrelevant tasks removed when editing work location
Browse files Browse the repository at this point in the history
  • Loading branch information
haoleanh committed Mar 28, 2024
1 parent 9c6f1bd commit 456d8a5
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 456d8a5

Please sign in to comment.