public long CreateEditionNoteVersion(long projectId, CreateEditionNoteContract data) { var userId = m_authenticationManager.GetCurrentUserId(); var resourceVersionId = new CreateEditionNoteVersionWork(m_resourceRepository, projectId, data, userId).Execute(); return(resourceVersionId); }
public CreateEditionNoteVersionWork(ResourceRepository resourceRepository, long projectId, CreateEditionNoteContract data, int userId) : base(resourceRepository) { m_resourceRepository = resourceRepository; m_projectId = projectId; m_data = data; m_userId = userId; }
public IActionResult SetEditionNote(CreateEditionNoteRequest request) { var client = GetProjectClient(); var data = new CreateEditionNoteContract { Text = request.Content, OriginalVersionId = request.OriginalVersionId }; var resourceVersionId = client.CreateEditionNote(request.ProjectId, data); return(Json(resourceVersionId)); }
public IActionResult CreateEditionNoteVersion(long projectId, [FromBody] CreateEditionNoteContract data) { m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.EditProject); try { var resultId = m_editionNoteManager.CreateEditionNoteVersion(projectId, data); return(Ok(resultId)); } catch (HttpErrorCodeException exception) { return(StatusCode((int)exception.StatusCode, exception.Message)); } }
public long CreateEditionNote(long projectId, CreateEditionNoteContract data) { try { return(m_client.Post <long>($"project/{projectId}/edition-note", data)); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }