diff --git a/Models/Repositories/PhSCustomerRepository.cs b/Models/Repositories/PhSCustomerRepository.cs index dc0544e..283e638 100644 --- a/Models/Repositories/PhSCustomerRepository.cs +++ b/Models/Repositories/PhSCustomerRepository.cs @@ -36,7 +36,7 @@ namespace Models.Repositories return customer != null ? EntityMapper.MapEntity(customer) : null; } - public async Task> SearchAsync(string? name, string? document, string? email) + public async Task> 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); diff --git a/phronCare.API/Controllers/Sales/CustomerController.cs b/phronCare.API/Controllers/Sales/CustomerController.cs index d5887bc..28c6ee5 100644 --- a/phronCare.API/Controllers/Sales/CustomerController.cs +++ b/phronCare.API/Controllers/Sales/CustomerController.cs @@ -28,12 +28,11 @@ namespace phronCare.API.Controllers.Sales } } [HttpGet("search")] - public async Task Search([FromQuery] string? name, [FromQuery] string? document, [FromQuery] string? email) + public async Task 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)