...
This commit is contained in:
@@ -69,12 +69,13 @@ namespace Hushian.WebApi.Controllers.v1
|
||||
public async Task<ActionResult> ChatsAwaitingOurResponse()
|
||||
{
|
||||
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();
|
||||
int ExperID = Convert.ToInt32(strExperID);
|
||||
ExperID = Convert.ToInt32(strExperID);
|
||||
|
||||
CompanyID = await _experService.GetCompanyIDExper(ExperID);
|
||||
CompanyID = await _experService.GetCompanyIDExper(ExperID.Value);
|
||||
}
|
||||
else if (User.IsInRole("Company"))
|
||||
{
|
||||
@@ -82,9 +83,31 @@ namespace Hushian.WebApi.Controllers.v1
|
||||
CompanyID = Convert.ToInt32(strCompanyID);
|
||||
}
|
||||
|
||||
var response = await _chatService.ChatsAwaitingOurResponse(CompanyID);
|
||||
var response = await _chatService.ChatsAwaitingOurResponse(CompanyID,ExperID);
|
||||
return Ok(response);
|
||||
}
|
||||
[HttpPut("Attached-to/{toExperID}/{ChatID}")]
|
||||
[Authorize(Roles = "Company,Exper")]
|
||||
public async Task<ActionResult> Attachedto(int toExperID,int ChatID)
|
||||
{
|
||||
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);
|
||||
|
||||
CompanyID = await _experService.GetCompanyIDExper(ExperID.Value);
|
||||
}
|
||||
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 _chatService.Attachedto(ChatID, ExperID,toExperID,CompanyID);
|
||||
return response ?NoContent(): BadRequest(new List<string> { "خطا در بروزرسانی وضعیت" });
|
||||
}
|
||||
[HttpPost("NewChatFromCurrentUser")]
|
||||
public async Task<ActionResult> NewChatFromCurrentUser(ADD_ConversationDto conversation)
|
||||
{
|
||||
|
Reference in New Issue
Block a user