public IActionResult PostUrl(UrlInputDTO urlInputDTO, int userid) { StatsDTO s = _usersService.CreateUrl(urlInputDTO, userid); if (s == null) { return(BadRequest()); } return(Created("api/stats/" + s.ID.ToString(), s)); }
public StatsDTO CreateUrl(UrlInputDTO urlInputDTO, int userid) { User user = this.GetByID(userid); if (user == null) { return(null); } Url url = _urlService.Create(urlInputDTO.Url, user); return(_statsService.Get(url)); }