Add Patch Error Compiler
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 4m16s

This commit is contained in:
Leandro Hernan Rojas 2025-04-05 19:32:05 -03:00
parent 143c3b45e7
commit 8b8e66086b
2 changed files with 4 additions and 5 deletions

View File

@ -36,7 +36,7 @@ namespace Models.Repositories
return customer != null ? EntityMapper.MapEntity<PhSCustomer, ECustomer>(customer) : null;
}
public async Task<IEnumerable<ECustomer>> SearchAsync(string? name, string? document, string? email)
public async Task<IEnumerable<ECustomer>> SearchAsync(string? name, string? email, string? document)
{
var query = _context.PhSCustomers
.Include(c => c.Accounttypes)
@ -71,8 +71,8 @@ namespace Models.Repositories
var customers = await query.ToListAsync();
Console.WriteLine($"VALOR RECIBIDO DE 'name': {name}");
Console.WriteLine($"VALOR RECIBIDO DE 'document': {document}");
Console.WriteLine($"VALOR RECIBIDO DE 'email': {email}");
Console.WriteLine($"VALOR RECIBIDO DE 'document': {document}");
return customers.Select(EntityMapper.MapEntity<PhSCustomer, ECustomer>);

View File

@ -28,12 +28,11 @@ namespace phronCare.API.Controllers.Sales
}
}
[HttpGet("search")]
public async Task<IActionResult> Search([FromQuery] string? name, [FromQuery] string? document, [FromQuery] string? email)
public async Task<IActionResult> Search([FromQuery] string? name, [FromQuery] string? email, [FromQuery] string? document)
{
try
{
var result = await _customerService.SearchAsync(name, document,);
var result = await _customerService.SearchAsync(name, document,);
var result = await _customerService.SearchAsync(name, email, document);
return Ok(result);
}
catch (Exception ex)