End of the day

This commit is contained in:
Cristiano
2025-11-06 17:51:00 +01:00
parent 76e48493f4
commit 0db72739aa
6 changed files with 24 additions and 22 deletions
@@ -6,7 +6,9 @@ using PyroFetes.Models;
namespace PyroFetes.Endpoints.Deliverers;
public class UpdateDelivererEndpoint(PyroFetesDbContext database) : Endpoint<UpdateDelivererDto, GetDelivererDto>
public class UpdateDelivererEndpoint(
PyroFetesDbContext database,
AutoMapper.IMapper mapper) : Endpoint<UpdateDelivererDto, GetDelivererDto>
{
public override void Configure()
{
@@ -29,11 +31,7 @@ public class UpdateDelivererEndpoint(PyroFetesDbContext database) : Endpoint<Upd
await database.SaveChangesAsync(ct);
await Send.OkAsync(new GetDelivererDto()
{
Id = deliverer.Id,
Transporter = deliverer.Transporter,
}, ct);
await Send.OkAsync(mapper.Map<GetDelivererDto>(deliverer), ct);
}
}