test
All checks were successful
Branch - test - Build and Push Backend API Docker Image / build-and-push (push) Successful in 25s

This commit is contained in:
Tizian.Breuch
2025-11-07 15:25:04 +01:00
parent 6bef982fcc
commit 55c75f84e4

View File

@@ -115,6 +115,7 @@ namespace Webshop.Application.Services.Admin
var existingProduct = await _context.Products.Include(p => p.Images).Include(p => p.Productcategories).FirstOrDefaultAsync(p => p.Id == productDto.Id);
if (existingProduct == null) { return ServiceResult.Fail(ServiceResultType.NotFound, $"Produkt mit ID '{productDto.Id}' nicht gefunden."); }
_context.Entry(existingProduct).Property(p => p.RowVersion).OriginalValue = productDto.RowVersion;
// SKU/Slug Checks bleiben gleich...
var skuExists = await _context.Products.AnyAsync(p => p.SKU == productDto.SKU && p.Id != productDto.Id);
if (skuExists) { return ServiceResult.Fail(ServiceResultType.Conflict, $"Ein anderes Produkt mit der SKU '{productDto.SKU}' existiert bereits."); }
@@ -151,7 +152,7 @@ namespace Webshop.Application.Services.Admin
existingProduct.Images.Add(new ProductImage { Url = url, IsMainImage = false, DisplayOrder = displayOrder++ });
}
}
_context.Entry(existingProduct).Property(p => p.RowVersion).OriginalValue = productDto.RowVersion;
// --- EIGENSCHAFTEN-UPDATE ---
Console.WriteLine("---- AKTUALISIERE PRODUKT-EIGENSCHAFTEN ----");