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

namespace phronCare.UIBlazor.Services.Sales
{
    public class BusinessUnitService
    {
        private readonly HttpClient _http;

        public BusinessUnitService(HttpClient http)
        {
            _http = http;
        }
        public async Task<List<EBusinessUnit>> GetAllAsync()
        {
            var result = await _http.GetFromJsonAsync<List<EBusinessUnit>>("/api/BusinessUnit/All");
            return result ?? new List<EBusinessUnit>();
        }

    }
}
