Fixed the issue where the application user ID was not being stored in the Employees table.
This commit is contained in:
parent
2e9459444f
commit
75183d1397
@ -167,7 +167,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
// Check if user already exists by email
|
||||
IdentityUser? existingUser = await _userHelper.GetRegisteredUser(model.Email);
|
||||
var existingEmployee = await _context.Employees.FirstOrDefaultAsync(e => e.Id == model.Id && e.IsActive == true);
|
||||
var demo = existingUser != new IdentityUser();
|
||||
|
||||
if (existingUser != null)
|
||||
{
|
||||
/* Identity user Exists - Create/update employee Employee */
|
||||
@ -228,7 +228,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
else
|
||||
{
|
||||
existingEmployee.Email = model.Email;
|
||||
existingEmployee = GetUpdateEmployeeModel(model, existingEmployee, existingUser);
|
||||
existingEmployee = GetUpdateEmployeeModel(model, existingEmployee, user);
|
||||
|
||||
_context.Employees.Update(existingEmployee);
|
||||
await _context.SaveChangesAsync();
|
||||
@ -473,7 +473,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
existingEmployee.PanNumber = model.PanNumber;
|
||||
existingEmployee.PermanentAddress = model.PermanentAddress;
|
||||
existingEmployee.PhoneNumber = model.PhoneNumber;
|
||||
existingEmployee.Photo = null; // GetFileDetails(model.Photo).Result.FileData,
|
||||
existingEmployee.Photo = existingEmployee.Photo; // GetFileDetails(model.Photo).Result.FileData,
|
||||
existingEmployee.JobRoleId = model.JobRoleId;
|
||||
|
||||
return existingEmployee;
|
||||
|
Loading…
x
Reference in New Issue
Block a user