public IActionResult CreateSearch(SearchForCreationOrUpdateDto searchUpdateDto) { var searches = _mapper.Map <SearchHistory>(searchUpdateDto); _dataService.CreateSearch(searches); return(Created("", searches)); }
public IActionResult UpdateSearch(int id, SearchForCreationOrUpdateDto searchUpdateDto) { var searches = _mapper.Map <SearchHistory>(searchUpdateDto); searches.UserId = id; //this fixes the id null value if (!_dataService.UpdateSearch(searches)) { return(NotFound()); } return(NoContent()); }