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

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

        public PeopleGroupService(HttpClient http)
        {
            _http = http;
        }

        public async Task<List<EPeopleGroup>> GetAllAsync()
        {
            var result = await _http.GetFromJsonAsync<List<EPeopleGroup>>("/api/PeopleGroup/All");
            return result ?? new List<EPeopleGroup>();
        }
    }
}
