using FaKrosnoEfDataModel.Dtos; namespace OrdersManagement.Services; public class ProductService(IHttpClientFactory httpClientFactory, CustomAuthenticationStateProvider authenticationStateProvider) : ServiceBase(httpClientFactory, authenticationStateProvider) { public async Task?> GetProductsByIndexAsync(string indexName) { try { return await GetListAsync($"api/Product/by-index?indexName={indexName}"); } catch (HttpRequestException ex) { Console.WriteLine($"Błąd HTTP w GetProductsByIndexAsync: {ex.Message}"); return null; } } public async Task UpdateProductAsync(ProductDto product) { return await PutAsJsonAsync("api/Product", product); } }