This commit is contained in:
Tizian.Breuch
2025-09-25 16:12:45 +02:00
parent c80b5ccc22
commit aaec80d7ad

View File

@@ -26,7 +26,6 @@ namespace Webshop.Application.Services.Customers
var customer = await _customerRepository.GetByUserIdAsync(userId);
if (customer == null)
{
// If the customer profile doesn't exist for a valid user, return an empty list.
return ServiceResult.Ok<IEnumerable<AddressDto>>(new List<AddressDto>());
}
@@ -67,8 +66,9 @@ namespace Webshop.Application.Services.Customers
var newAddress = new Address
{
CustomerId = customer.Id,
FirstName = addressDto.FirstName ?? customer.FirstName,
LastName = addressDto.LastName ?? customer.LastName,
// << KORREKTUR: Namen vom Kundenprofil übernehmen, da sie im DTO nicht vorhanden sind. >>
FirstName = customer.FirstName,
LastName = customer.LastName,
Street = addressDto.Street,
HouseNumber = addressDto.HouseNumber,
City = addressDto.City,