From f94a7de4abf1d34904157042b330ae94086ca181 Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Wed, 1 Oct 2025 17:46:11 +0530 Subject: [PATCH] change email in complete system --- Marco.Pms.Services/Controllers/EmployeeController.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Marco.Pms.Services/Controllers/EmployeeController.cs b/Marco.Pms.Services/Controllers/EmployeeController.cs index 1cac04c..52a787e 100644 --- a/Marco.Pms.Services/Controllers/EmployeeController.cs +++ b/Marco.Pms.Services/Controllers/EmployeeController.cs @@ -680,10 +680,10 @@ namespace MarcoBMS.Services.Controllers if (!string.IsNullOrWhiteSpace(model.Email)) { var emailExists = await _context.Employees - .AnyAsync(e => e.Email == model.Email && e.OrganizationId == model.OrganizationId); + .AnyAsync(e => e.Email == model.Email); if (emailExists) { - _logger.LogInfo("Employee email already exists in org. Email={Email}, Org={OrgId}", model.Email, model.OrganizationId); + _logger.LogInfo("Employee email already exists. Email={Email}", model.Email); return StatusCode(403, ApiResponse.ErrorResponse( "Employee with email already exists", "Employee with this email already exists", 403)); @@ -1007,7 +1007,7 @@ namespace MarcoBMS.Services.Controllers if (string.IsNullOrWhiteSpace(existingEmployee.Email) && !string.IsNullOrWhiteSpace(model.Email)) { var emailExists = await _context.Employees - .AnyAsync(e => e.Email == model.Email && e.OrganizationId == model.OrganizationId); + .AnyAsync(e => e.Email == model.Email); if (emailExists) { @@ -1245,7 +1245,6 @@ namespace MarcoBMS.Services.Controllers } - // Prepare reset link sender helper private async Task SendResetIfApplicableAsync(ApplicationUser u, string firstName) {