public async Task <IActionResult> UpdateJobDefinition(int projectId, int jobId, UpdateJobDefinitionDto jobDefinition) { _logger.LogInformation("Updating job definition {jobId} in project {projectId}. Request body: {@jobDefinition}", jobId, projectId, jobDefinition); try { if (jobId != jobDefinition.Id) { _logger.LogWarning("Job Id doesn't match."); return(BadRequest("Job Id doesn't match.")); } await _jobDefinitionService.RenameJobDefinition(jobId, jobDefinition.Name); return(Ok()); } catch (DuplicateJobDefinitionException ex) { _logger.LogWarning(ex, "Duplicate job definition name"); return(BadRequest(ex.Message)); } }