mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 04:20:55 +00:00
26 lines
733 B
Plaintext
26 lines
733 B
Plaintext
@page "/location/{LocationId:int}"
|
|
@inject HttpClient http
|
|
@using CartriX.Web.Pages.LocationsPage.Components
|
|
|
|
|
|
@foreach(var printer in printersItems)
|
|
{
|
|
<PrinterCard printerItem="printer"/>
|
|
}
|
|
|
|
@code {
|
|
[Parameter] public int LocationId { get; set; }
|
|
List<Models.Printer.PrinterItemList> printersItems = new();
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await GetPrintersItems();
|
|
}
|
|
async Task GetPrintersItems()
|
|
{
|
|
var responce = await http.GetAsync(ApiRoutes.Location.ListPrinters(LocationId));
|
|
var json = await responce.Content.ReadAsStringAsync();
|
|
|
|
printersItems = JsonConvert.DeserializeObject<List<Models.Printer.PrinterItemList>>(json) ?? new();
|
|
}
|
|
} |