public async Task <IActionResult> LogWork([FromBody] CreateWorkLogDto dto, string issueKey) { var response = await _jiraProxy.PostAsJsonAsync($"/rest/api/2/issue/{issueKey}/worklog", dto); if (response.StatusCode != HttpStatusCode.OK) { throw new JiraException(await response.Content.ReadAsStringAsync()); } return(Success()); }
public async Task <IActionResult> CreateWorkLog([FromBody] CreateWorkLogDto createDto) { try { var workLog = _mapper.Map <CreateWorkLogDto, WorkLog>(createDto); await _workLogService.SaveWorkLog(workLog); return(CreatedAtAction( nameof(GetWorkLog), new { id = workLog.Id }, _mapper.Map <WorkLog, WorkLogDto>(workLog))); } catch (EntityNotFoundException ex) { return(BadRequest(new ErrorResponse { Code = ErrorCodes.CouldNotCreateWorkLog, Reason = ex.Message })); } }