Ejemplo n.º 1
0
 public async Task <ActionResult <Question> > HideQuestion([FromRoute] int id, [FromBody] QuestionAnswerHideRequest request)
 {
     try
     {
         return(Ok(await questionService.HideQuestion(id, UserName, Role, request.ModeratorMessage)));
     }
     catch (NotFoundException)
     {
         return(NotFound());
     }
     catch (ForbiddenException)
     {
         return(Forbid());
     }
 }
Ejemplo n.º 2
0
 public async Task <IActionResult> HideAnswer([FromRoute] int qId, [FromRoute] int aId, [FromBody] QuestionAnswerHideRequest request)
 {
     try
     {
         return(Ok(await questionService.HideAnswer(qId, aId, request.ModeratorMessage, UserName, Role)));
     }
     catch (ForbiddenException)
     {
         return(Forbid());
     }
     catch (NotFoundException)
     {
         return(NotFound());
     }
 }