phronCare/phronCare.UIBlazor/Services/Sales/CustomerHttpService.cs
Leandro Hernan Rojas b60a8bdd0f
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 4m37s
Add Patch Customer endpoint
2025-04-06 18:23:47 -03:00

26 lines
850 B
C#

using Domain.Entities;
using Domain.Generics;
using System.Net.Http.Json;
namespace phronCare.UIBlazor.Services.Sales
{
public class CustomerHttpService
{
private readonly HttpClient _http;
public CustomerHttpService(HttpClient http)
{
_http = http;
}
public async Task<PagedResult<ECustomer>?> SearchCustomersAsync(CustomerSearchParams searchParams)
{
var url = $"api/Customer/search?" +
$"name={searchParams.Name}&" +
$"email={searchParams.Email}&" +
$"document={searchParams.Document}&" +
$"page={searchParams.Page}&" +
$"pageSize={searchParams.PageSize}";
return await _http.GetFromJsonAsync<PagedResult<ECustomer>>(url);
}
}
}