...
This commit is contained in:
@@ -82,6 +82,27 @@ namespace Hushian.WebApi.Controllers.v1
|
||||
var response = await _experService.GetInfoExper(ExperID);
|
||||
return response != null ? Ok(response) : BadRequest(new List<string> { "یافت نشد" });
|
||||
}
|
||||
[HttpGet("GetCurrentUserInfo")]
|
||||
[Authorize(Roles = "Exper,Company")]
|
||||
public async Task<ActionResult> GetCurrentUserInfo()
|
||||
{
|
||||
int CompanyID = 0;
|
||||
int? ExperID = null;
|
||||
if (User.IsInRole("Exper"))
|
||||
{
|
||||
string strExperID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
|
||||
ExperID = Convert.ToInt32(strExperID);
|
||||
|
||||
}
|
||||
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 _experService.GetCurrentUserInfo(CompanyID,ExperID);
|
||||
return response != null ? Ok(response) : BadRequest(new List<string> { "یافت نشد" });
|
||||
}
|
||||
[HttpPut("ExperEditingFromManager/{ExperID}")] //ویرایش کارشناس توسط مدیرش
|
||||
[Authorize(Roles = "Company")]
|
||||
public async Task<ActionResult> ExperEditingFromManager(int ExperID, [FromBody] Update_ExperDto editUser)
|
||||
|
Reference in New Issue
Block a user