From 26d127ccf8eccee5258df7c251fab6e8f50d4242 Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Thu, 15 Dec 2022 15:17:42 +0330 Subject: [PATCH] fixes --- .../GanjoorService-ModerateSectionCorrection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateSectionCorrection.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateSectionCorrection.cs index e540ec81..35ab6104 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateSectionCorrection.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateSectionCorrection.cs @@ -898,7 +898,7 @@ namespace RMuseum.Services.Implementation var deletedUserId = (Guid)(await _appUserService.FindUserByEmail(deletedUserEmail)).Result.Id; var dbCorrection = await _context.GanjoorPoemSectionCorrections.AsNoTracking().Include(c => c.User) - .Where(c => c.Reviewed == false && (deletedUserSections == false || c.UserId == deletedUserId)) + .Where(c => c.Reviewed == false && ((deletedUserSections == false && c.UserId != deletedUserId ) || c.UserId == deletedUserId)) .OrderBy(c => c.Id) .Skip(skip) .FirstOrDefaultAsync(); @@ -1021,7 +1021,7 @@ namespace RMuseum.Services.Implementation string deletedUserEmail = $"{Configuration.GetSection("Ganjoor")["DeleteUserEmail"]}"; var deletedUserId = (Guid)(await _appUserService.FindUserByEmail(deletedUserEmail)).Result.Id; return new RServiceResult(await _context.GanjoorPoemSectionCorrections.AsNoTracking() - .Where(c => c.Reviewed == false && (deletedUserSections == false || c.UserId == deletedUserId)) + .Where(c => c.Reviewed == false && ((deletedUserSections == false && c.UserId != deletedUserId) || c.UserId == deletedUserId)) .CountAsync()); } }