public IActionResult Index() { var searchHistory = api.GetSearchHistory(Guid.Parse(User.FindFirstValue(ClaimTypes.Sid))); var model = new AccountIndexViewModel(){ name = User.Identity.Name, email = User.FindFirstValue(ClaimTypes.Email), history = new List<History>(searchHistory), modifyPassword = new ModifyPasswordViewModel() }; return View(model); }
public IActionResult GetHistory() { try{ var searchHistory = api.GetSearchHistory(Guid.Parse(User.FindFirstValue(ClaimTypes.Sid))); return(Json(searchHistory)); } catch (Exception e) { return(StatusCode(412, e.Message)); } }