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) {