Initial commit of LittleShop project (excluding large archives)
- BTCPay Server integration - TeleBot Telegram bot - Review system - Admin area - Docker deployment configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -258,11 +258,11 @@ public class ProductService : IProductService
|
||||
var product = await _context.Products.FindAsync(photoDto.ProductId);
|
||||
if (product == null) return null;
|
||||
|
||||
var maxSortOrder = await _context.ProductPhotos
|
||||
var existingPhotos = await _context.ProductPhotos
|
||||
.Where(pp => pp.ProductId == photoDto.ProductId)
|
||||
.Select(pp => pp.SortOrder)
|
||||
.DefaultIfEmpty(0)
|
||||
.MaxAsync();
|
||||
.ToListAsync();
|
||||
|
||||
var maxSortOrder = existingPhotos.Any() ? existingPhotos.Max(pp => pp.SortOrder) : 0;
|
||||
|
||||
var productPhoto = new ProductPhoto
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user