using Domain.Entities;
using System.Net.Http.Json;

namespace phronCare.UIBlazor.Services.Sales
{
    public class ProductCategoryService
    {
        private readonly HttpClient _http;
        public ProductCategoryService(HttpClient http)
        {
            _http = http;
        }
        public async Task<List<EProductCategory>> GetAllAsync()
        {
            var result = await _http.GetFromJsonAsync<List<EProductCategory>>("/api/ProductCategory/All");
            return result ?? new List<EProductCategory>();
        }
    }
}
