public IActionResult AddNewProgress([FromBody] PatientProgressViewModel userInput) { // TODO Add try and catch error string PatientId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; var model = _mapper.Map <PatientProgressModel>(userInput); model.PatientId = PatientId; model.AddedBy = PatientId; _patientProgressData.AddProgress(model); return(Ok()); }
public IActionResult AddNew(string patientId, [FromBody] PatientProgressViewModel userInput) { try { var model = _mapper.Map <PatientProgressModel>(userInput); model.PatientId = patientId; model.AddedBy = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; _patientProgressData.AddProgress(model); return(Ok()); } catch (Exception ex) { _apiErrorHandler.CreateError(ex.Source, ex.StackTrace, ex.Message); } return(StatusCode(500)); }