public IActionResult SaveComment(CreateTextCommentContract comment, long textId) { var client = GetProjectClient(); var result = client.CreateComment(textId, comment); return(Json(result)); }
public CreateNewTextCommentWork(ResourceRepository resourceRepository, long textId, CreateTextCommentContract newComment, int userId) : base(resourceRepository) { m_resourceRepository = resourceRepository; m_textId = textId; m_newComment = newComment; m_userId = userId; }
public long CreateNewComment(long textId, CreateTextCommentContract newComment) { var userId = m_authenticationManager.GetCurrentUserId(); var createNewCommentWork = new CreateNewTextCommentWork(m_resourceRepository, textId, newComment, userId); var resultId = createNewCommentWork.Execute(); return(resultId); }
public IActionResult CreateComment(long textId, [FromBody] CreateTextCommentContract request) { m_authorizationManager.AuthorizeResource(textId, PermissionFlag.EditProject); try { var resultId = m_projectContentManager.CreateNewComment(textId, request); return(Ok(resultId)); } catch (HttpErrorCodeException exception) { return(StatusCode((int)exception.StatusCode, exception.Message)); } }
public void UpdateComment(long commentId, CreateTextCommentContract request) { try { m_client.Put <object>($"project/text/comment/{commentId}", request); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public long CreateComment(long textId, CreateTextCommentContract request) { try { var result = m_client.Post <long>($"project/text/{textId}/comment", request); return(result); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public void UpdateComment(CreateTextCommentContract comment, long commentId) { var client = GetProjectClient(); client.UpdateComment(commentId, comment); }