public async Task <ActionResult> deleteRoom(string roomId) { int code = 200; BaseResponse response = null; try { HttpResponseMessage responseContent = await _service.deleteRoom(roomId); var responseStream = await responseContent.Content.ReadAsStreamAsync(); var jsonresponse = await JsonSerializer.DeserializeAsync <Object>(responseStream); response = new ItemResponse <Object> { Item = jsonresponse }; } catch (Exception ex) { code = 500; Logger.LogError(ex.ToString()); response = new ErrorResponse(ex.Message); } return(StatusCode(code, response)); }
public async Task EndVideoChat() { try { int userId = _authService.GetCurrentUserId(); string chatRoomId = await _chatHubService.GetCurrentUserRoom(userId); HttpResponseMessage response = await _videoChatService.deleteRoom(chatRoomId); var responseStream = await response.Content.ReadAsStreamAsync(); var jsonresponse = await JsonSerializer.DeserializeAsync <Object>(responseStream); var finalResponse = new ItemResponse <Object> { Item = jsonresponse }; await Clients.Group(chatRoomId).SendAsync("AddVideoMessage", finalResponse); } catch (Exception ex) { await Clients.Caller.SendAsync("AddVideoMessage", null, ex); } }