change email in complete system

This commit is contained in:
ashutosh.nehete 2025-10-01 17:46:11 +05:30
parent eb3a65428e
commit f94a7de4ab

View File

@ -680,10 +680,10 @@ namespace MarcoBMS.Services.Controllers
if (!string.IsNullOrWhiteSpace(model.Email)) if (!string.IsNullOrWhiteSpace(model.Email))
{ {
var emailExists = await _context.Employees var emailExists = await _context.Employees
.AnyAsync(e => e.Email == model.Email && e.OrganizationId == model.OrganizationId); .AnyAsync(e => e.Email == model.Email);
if (emailExists) 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<object>.ErrorResponse( return StatusCode(403, ApiResponse<object>.ErrorResponse(
"Employee with email already exists", "Employee with email already exists",
"Employee with this email already exists", 403)); "Employee with this email already exists", 403));
@ -1007,7 +1007,7 @@ namespace MarcoBMS.Services.Controllers
if (string.IsNullOrWhiteSpace(existingEmployee.Email) && !string.IsNullOrWhiteSpace(model.Email)) if (string.IsNullOrWhiteSpace(existingEmployee.Email) && !string.IsNullOrWhiteSpace(model.Email))
{ {
var emailExists = await _context.Employees var emailExists = await _context.Employees
.AnyAsync(e => e.Email == model.Email && e.OrganizationId == model.OrganizationId); .AnyAsync(e => e.Email == model.Email);
if (emailExists) if (emailExists)
{ {
@ -1245,7 +1245,6 @@ namespace MarcoBMS.Services.Controllers
} }
// Prepare reset link sender helper // Prepare reset link sender helper
private async Task SendResetIfApplicableAsync(ApplicationUser u, string firstName) private async Task SendResetIfApplicableAsync(ApplicationUser u, string firstName)
{ {