Skip to content

Commit

Permalink
Remove logger from endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
John Miller committed Aug 20, 2024
1 parent 68cf491 commit 722b3d4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Microservice.Customer.Api/Endpoints/Endpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,10 @@ public static void ConfigureRoutes(this WebApplication app, ConfigurationManager
});

customerGroup.MapPut("/update", [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
async ([FromBody] UpdateCustomerRequest updateCustomerRequest, [FromServices] IMediator mediator, ICustomerHttpAccessor customerHttpAccessor, ILogger logger) =>
{
logger.LogInformation("Start - Update customer: {0}", updateCustomerRequest.Id);

async ([FromBody] UpdateCustomerRequest updateCustomerRequest, [FromServices] IMediator mediator, ICustomerHttpAccessor customerHttpAccessor) =>
{
updateCustomerRequest = updateCustomerRequest with { Id = customerHttpAccessor.CustomerId };
var updateCustomerResponse = await mediator.Send(updateCustomerRequest);

logger.LogInformation("End - Update customer: {0}", updateCustomerRequest.Id);

var updateCustomerResponse = await mediator.Send(updateCustomerRequest);
return Results.Ok(updateCustomerResponse);
})
.Accepts<UpdateCustomerRequest>("application/json")
Expand Down

0 comments on commit 722b3d4

Please sign in to comment.