All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 16m35s
29 lines
918 B
C#
29 lines
918 B
C#
using Domain.Entities;
|
|
using phronCare.UIBlazor.Services.Lookups;
|
|
using System.Net.Http.Json;
|
|
|
|
public class StockLookUpService: IStockLookUpService
|
|
{
|
|
private readonly HttpClient _http;
|
|
|
|
public StockLookUpService(HttpClient http)
|
|
{
|
|
_http = http;
|
|
}
|
|
|
|
public async Task<List<ELookUpItem>> GetProductDivisionsAsync(string filter = "")
|
|
{
|
|
string url = string.IsNullOrWhiteSpace(filter)
|
|
? "/api/LSMLookUp/productdivisions"
|
|
: $"/api/LSMLookUp/productdivisions?q={Uri.EscapeDataString(filter)}";
|
|
|
|
var result = await _http.GetFromJsonAsync<List<ELookUpItem>>(url);
|
|
return result ?? new List<ELookUpItem>();
|
|
}
|
|
public async Task<List<ELookUpItem>> GetUnitsOfMeasureAsync(string filter = "")
|
|
{
|
|
var result = await _http.GetFromJsonAsync<List<ELookUpItem>>($"/api/LSMLookUp/units?q={filter}");
|
|
return result ?? [];
|
|
}
|
|
}
|