From 456d8a521c4fdd66c26052d7665c8e393a22b2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hao=20L=C3=AA=20Anh?= Date: Thu, 28 Mar 2024 16:57:29 +0700 Subject: [PATCH] fix issue where irrelevant tasks removed when editing work location --- .../WorkLocation/WorkLocationCommandRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Valghalla.Internal.Infrastructure/Modules/Administration/WorkLocation/WorkLocationCommandRepository.cs b/Valghalla.Internal.Infrastructure/Modules/Administration/WorkLocation/WorkLocationCommandRepository.cs index 51824f6..e43240b 100644 --- a/Valghalla.Internal.Infrastructure/Modules/Administration/WorkLocation/WorkLocationCommandRepository.cs +++ b/Valghalla.Internal.Infrastructure/Modules/Administration/WorkLocation/WorkLocationCommandRepository.cs @@ -99,7 +99,7 @@ public async Task 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) {