public void UpdateThreadTitle(ThreadUpdateTitle input) { // check user and permissions Session.EnsureAuthenticated(); var threadModel = _threadRepository.Find(input.Id); if (threadModel.Title == input.Title) { throw new Exceptions.BadRequestException("NOTHING_CHANGED"); } threadModel.Title = input.Title; threadModel.UpdatedAt = DateTime.UtcNow; threadModel.UpdatedByUserId = Session.AuthenticatedUserId.Value; _threadRepository.Update(threadModel); }
public IActionResult UpdateThreadTitle([FromBody] ThreadUpdateTitle input) { _threadService.UpdateThreadTitle(input); return(Ok()); }