public IActionResult GetReportingStructureByEmployeeId(String id) { _logger.LogDebug($"Received reporting structure get request for employee '{id}'"); var reportingStructure = _reportingStructureService.GetByEmployeeId(id); if (reportingStructure == null) { return(NotFound()); } return(Ok(reportingStructure)); }
public IActionResult GetEmployeeReportStructById(string id) { _logger.LogDebug($"Received ReportingStructure GET request for '{id}'"); var strc = _reportingStructureService.GetByEmployeeId(id); if (strc == null) { return(NotFound()); } return(Ok(strc)); }
public IActionResult Get(string id) { _logger.LogDebug($"Received Get Reporting Structure request for Employee [Id: {id}]."); ReportingStructure reportingStructure; try { reportingStructure = _reportingStructureService.GetByEmployeeId(id); } catch (EmployeeNotFoundException e) { return(StatusCode((int)HttpStatusCode.NotFound, e.Message)); } catch (Exception e) { return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message)); } return(Ok(reportingStructure)); }