public ActionResult GetMemberProjects() { try { return(new JsonResult(_service.GetMemberProjects())); } catch (Exception e) { _logger.LogWarning($"GetMemberProjects method {e}"); var errors = ExceptionsChecker.CheckProfileException(e); return(BadRequest(errors)); } }
public IActionResult GetMemberAvatar(int memberId) { try { var result = _avatarService.GetAvatar(memberId); return(Ok(result)); } catch (Exception e) { _logger.LogWarning($"GetMemberAvatar method with parameters ({memberId});\n {e}"); var errors = ExceptionsChecker.CheckProfileException(e); return(BadRequest(errors)); } }
public ActionResult GetProjectMembers(int projectId) { try { var result = _service.GetProjectMembers(projectId); return(Ok(result)); } catch (Exception e) { _logger.LogWarning($"GetProjectMembers method with parameters ({projectId});\n {e}"); var errors = ExceptionsChecker.CheckProfileException(e); return(BadRequest(errors)); } }
public IActionResult GetDateFormats() { try { var result = _service.GetDateFormats(); return(new JsonResult(result)); } catch (Exception e) { _logger.LogWarning($"GetDateFormats method {e}"); var errors = ExceptionsChecker.CheckProfileException(e); return(BadRequest(errors)); } }
public IActionResult GetMemberIcon(int memberId) { try { var result = _service.GetMemberIcon(this.GetUserNameWithImpersonation(), memberId); return(Ok(result)); } catch (Exception e) { _logger.LogWarning($"GetMemberIcon method with parameters ({memberId});\n {e}"); var errors = ExceptionsChecker.CheckProfileException(e); return(BadRequest(errors)); } }
public IActionResult Patch(int id, [FromBody] MemberPersonalInfoView memberPersonalInfoView) { memberPersonalInfoView.Id = id; try { var waitResult = _service.PatchPersonalInfo(memberPersonalInfoView); return(Ok(waitResult)); } catch (Exception e) { _logger.LogWarning($"Patch method with parameters ({id}, {memberPersonalInfoView});\n {e}"); var errors = ExceptionsChecker.CheckProfileException(e); return(BadRequest(errors)); } }
public IActionResult UpdateMemberAvatar(IFormFile file) { if (file != null) { try { var result = _avatarService.SetUpdateMemberAvatar(file); return(Ok(result)); } catch (Exception e) { _logger.LogWarning($"UpdateMemberAvatar method {e}"); var errors = ExceptionsChecker.CheckProfileException(e); return(BadRequest(errors)); } } return(BadRequest("File is empty")); }