Stopping multiple entries in employee-bucket mapping table
This commit is contained in:
parent
55e8ace430
commit
591b54c901
@ -1195,7 +1195,7 @@ namespace Marco.Pms.Services.Helpers
|
||||
}
|
||||
var employeeBuckets = await _context.EmployeeBucketMappings.Where(eb => eb.BucketId == bucketId).ToListAsync();
|
||||
var bucketIds = employeeBuckets.Where(eb => eb.EmployeeId == LoggedInEmployee.Id).Select(eb => eb.BucketId).ToList();
|
||||
|
||||
var employeeBucketIds = employeeBuckets.Select(eb => eb.EmployeeId).ToList();
|
||||
Bucket? accessableBucket = null;
|
||||
if (permissionIds.Contains(directoryAdmin))
|
||||
{
|
||||
@ -1224,7 +1224,7 @@ namespace Marco.Pms.Services.Helpers
|
||||
{
|
||||
if (employeeIds.Contains(assignBucket.EmployeeId))
|
||||
{
|
||||
if (assignBucket.IsActive)
|
||||
if (assignBucket.IsActive && !employeeBucketIds.Contains(assignBucket.EmployeeId))
|
||||
{
|
||||
EmployeeBucketMapping employeeBucketMapping = new EmployeeBucketMapping
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user