예제 #1
0
 public ActionResult <Guid> AddTemplateGenerator(
     Guid topicId,
     Guid levelId,
     [FromBody] TemplateGeneratorDTO templateGenerator)
 {
     var(_, isFailure, id, error) = applicationApi
                                    .AddTemplateGenerator(
         topicId,
         levelId,
         templateGenerator.Text,
         templateGenerator.PossibleAnswers,
         templateGenerator.Answer, templateGenerator.Hints, templateGenerator.Streak,
         templateGenerator.Question);
     if (isFailure)
     {
         return(NotFound(error.Message));
     }
     return(Ok(id));
 }