Added Blazor projects. Minor API/core updates.
This commit is contained in:
46
JSMR.UI.Blazor/Pages/VoiceWorks.razor
Normal file
46
JSMR.UI.Blazor/Pages/VoiceWorks.razor
Normal file
@@ -0,0 +1,46 @@
|
||||
@page "/voiceworks"
|
||||
@using JSMR.Application.VoiceWorks.Queries.Search
|
||||
@inject VoiceWorksClient Client
|
||||
|
||||
<PageTitle>Voice Works</PageTitle>
|
||||
|
||||
<h3>VoiceWorks</h3>
|
||||
|
||||
@if (items is null)
|
||||
{
|
||||
<p>Loading…</p>
|
||||
}
|
||||
else if (items.Count == 0)
|
||||
{
|
||||
<p>No results.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<ul>
|
||||
@foreach (var v in items)
|
||||
{
|
||||
<li>@v.ProductId – @v.ProductName</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
|
||||
@code {
|
||||
List<VoiceWorkSearchResult>? items;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
SearchVoiceWorksRequest request = new(
|
||||
Options: new()
|
||||
);
|
||||
|
||||
var result = await Client.SearchAsync(request);
|
||||
|
||||
// if (result.Ok)
|
||||
// {
|
||||
// items = result.Value!.Results.Items.ToList();
|
||||
// }
|
||||
//items = result.Value?.Results.Items ?? [];
|
||||
|
||||
items = result.Results.Items.ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user