Added functionality to remove entries from the employee-role mapping when IsEnabled is set to false.
This commit is contained in:
parent
4ec27709c9
commit
512a899310
@ -109,10 +109,11 @@ namespace MarcoBMS.Services.Controllers
|
||||
|
||||
_context.EmployeeRoleMappings.Add(mapping);
|
||||
}
|
||||
else
|
||||
else if (role.IsEnabled == false)
|
||||
{
|
||||
_context.EmployeeRoleMappings.Update(mapping);
|
||||
_context.EmployeeRoleMappings.Remove(existingItem);
|
||||
}
|
||||
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user