diff --git a/Microservice.Customer.Api/Endpoints/Endpoints.cs b/Microservice.Customer.Api/Endpoints/Endpoints.cs index 4ea5b9f..993a373 100644 --- a/Microservice.Customer.Api/Endpoints/Endpoints.cs +++ b/Microservice.Customer.Api/Endpoints/Endpoints.cs @@ -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("application/json")