Skip to content

Commit

Permalink
77: Added null check for answer text on Question details page
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmatys committed May 16, 2024
1 parent d064ab8 commit a285128
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task<Result<GetQuestionResponse>> Handle(GetQuestionQuery query, Ca

return new GetQuestionResponse(
question.Text,
question.Answer!.Text,
question.Answer?.Text,
question.Context!.Value,
resources);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ASSISTENTE.Contract.Requests.Internal.Questions.Queries.GetQuestion;

public sealed record GetQuestionResponse(
string Text,
string Answer,
string? Answer,
QuestionContext Context,
List<ResourceDto> Resources
);
9 changes: 8 additions & 1 deletion API/ASSISTENTE.UI/Pages/Questions/Details.razor
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@
<MudGrid Class="mb-3">
<MudItem xs="12" sm="12">
<h2 class="mb-2">Answer</h2>
<MarkdownArea Content="@_response.Answer"/>
@if (_response.Answer is not null)
{
<MarkdownArea Content="@_response.Answer"/>
}
else
{
<p>Generation in progress, please wait...</p>
}
</MudItem>
</MudGrid>

Expand Down

0 comments on commit a285128

Please sign in to comment.