This commit is contained in:
mmrbnjd
2025-10-24 14:26:20 +03:30
parent 58975ce589
commit 214112a92a
21 changed files with 559 additions and 2893 deletions

View File

@@ -50,7 +50,18 @@ namespace Hushian.WebApi.Controllers.v1
int UserID = Convert.ToInt32(strUserID);
var response = await _chatService.GetLastOpenChatInCompany(CompanyID,UserID);
return response.Success ? Ok(response.Value) : Accepted() ;
return Ok(response);
}
[HttpGet("User/LastChat")]
[Authorize(Roles = "User")]
public async Task<ActionResult> GetLastChat()
{
string strUserID = User.Claims.Where(w => w.Type == CustomClaimTypes.Uid).Select(s => s.Value).First();
int UserID = Convert.ToInt32(strUserID);
var response = await _chatService.GetLastChat(UserID);
return Ok(response);
}
[HttpGet("User/Chat/{ChatID}")]
@@ -61,7 +72,7 @@ namespace Hushian.WebApi.Controllers.v1
int UserID = Convert.ToInt32(strUserID);
var response = await _chatService.GetChat(ChatID, UserID);
return response.Success ? Ok(response.Value) : Accepted();
return response==null ? NotFound() : Ok(response);
}
[HttpGet("ChatsAwaitingOurResponse")]