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);
|
_context.EmployeeRoleMappings.Add(mapping);
|
||||||
}
|
}
|
||||||
else
|
else if (role.IsEnabled == false)
|
||||||
{
|
{
|
||||||
_context.EmployeeRoleMappings.Update(mapping);
|
_context.EmployeeRoleMappings.Remove(existingItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
@ -304,7 +305,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
responsemessage = "User created successfully.";
|
responsemessage = "User created successfully.";
|
||||||
|
|
||||||
}
|
}
|
||||||
return Ok(ApiResponse<object>.SuccessResponse("Success.",responsemessage, 200));
|
return Ok(ApiResponse<object>.SuccessResponse("Success.", responsemessage, 200));
|
||||||
}
|
}
|
||||||
#nullable disable
|
#nullable disable
|
||||||
private static Employee GetNewEmployeeModel(CreateUserDto model, int TenantId, string ApplicationUserId)
|
private static Employee GetNewEmployeeModel(CreateUserDto model, int TenantId, string ApplicationUserId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user