GetExpersCompany
GetGroupsCompany
This commit is contained in:
@@ -12,11 +12,11 @@ namespace Hushian.WebApi.Controllers.v1
|
||||
public class GroupController : ControllerBase
|
||||
{
|
||||
private readonly GroupService _groupService;
|
||||
private readonly CompanyService _companyService;
|
||||
public GroupController(GroupService groupService, CompanyService companyService)
|
||||
private readonly ExperService _experService;
|
||||
public GroupController(GroupService groupService, ExperService experService)
|
||||
{
|
||||
_groupService = groupService;
|
||||
_companyService = companyService;
|
||||
_experService = experService;
|
||||
}
|
||||
|
||||
[HttpPost("AddGroup")]
|
||||
@@ -76,8 +76,19 @@ namespace Hushian.WebApi.Controllers.v1
|
||||
|
||||
if (!CompanyID.HasValue)
|
||||
{
|
||||
string strCompanyID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
|
||||
CompanyID = Convert.ToInt32(strCompanyID);
|
||||
if (User.IsInRole("Exper"))
|
||||
{
|
||||
string strExperID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
|
||||
int ExperID = Convert.ToInt32(strExperID);
|
||||
CompanyID =await _experService.GetCompanyIDExper(ExperID);
|
||||
}
|
||||
else if (User.IsInRole("Company"))
|
||||
{
|
||||
string strCompanyID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
|
||||
CompanyID = Convert.ToInt32(strCompanyID);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
var response = await _groupService.GetGroupsCompany(CompanyID.Value);
|
||||
return Ok(response);
|
||||
|
Reference in New Issue
Block a user