Add endpoint to display all customers, and updated dto to create quotation and purchase order
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using FastEndpoints;
|
||||
using PyroFetes.DTO.Customer.Response;
|
||||
using PyroFetes.Repositories;
|
||||
|
||||
namespace PyroFetes.Endpoints.Customers;
|
||||
|
||||
public class GetAllCustomersEndpoint(CustomersRepository customersRepository, AutoMapper.IMapper mapper) : EndpointWithoutRequest<List<GetCustomerDto>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/customers");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
{
|
||||
await Send.OkAsync(await customersRepository.ProjectToListAsync<GetCustomerDto>(ct), ct);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user