public ActionResult PutAnswer(int problemId, int answerId, AnswerUserModel answer) { var result = _problemService.EditAnswer(problemId, answerId, answer.ToModel()); if (result == false) { return(Forbid()); } return(Ok()); }
public ActionResult PostAnswer(int problemId, AnswerUserModel answer) { var answerId = _problemService.CreateAnswer(problemId, answer.ToModel()); if (answerId == 0) { return(Forbid()); } return(Ok(new Answer { Id = answerId })); }
public ActionResult PatchAnswer(int problemId, int answerId, AnswerUserModel answer) { _problemService.SetAnswerApproval(problemId, answerId, answer.IsApproved); return(Ok()); }