public ActionResult AddDocument([FromBody] DocumentModel document) { _logger.LogInformation("Adding a new document"); document.UploadedOn = DateTime.UtcNow; var documentData = DocumentMapper.SerializeDocument(document); var newDocument = _documentService.CreateDocument(documentData); return(Ok(newDocument)); }
public ActionResult UpdateDocument([FromBody] DocumentModel document) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var documentData = DocumentMapper.SerializeDocument(document); var newDocument = _documentService.UpdateDocument(documentData); return(Ok(newDocument)); }