Fix: Remove filtered Include for variants in GetProductsByCategoryAsync

Previous commit (e931f77) only fixed GetAllProductsAsync and GetProductByIdAsync.
This commit fixes GetProductsByCategoryAsync which also had the broken filtered Include syntax.

**Impact**: Variants will now appear when browsing products by category in TeleBot.

🤖 Generated with Claude Code
https://claude.com/claude-code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
SysAdmin 2025-10-04 17:45:13 +01:00
parent e931f772fb
commit 22e910862a
2 changed files with 4 additions and 3 deletions

View File

@ -40,7 +40,8 @@
"Bash(./check-api-key.sh:*)", "Bash(./check-api-key.sh:*)",
"Bash(/tmp/fix-celery-beat.sh:*)", "Bash(/tmp/fix-celery-beat.sh:*)",
"Bash(/tmp/bypass-hdwallet-unlock.sh:*)", "Bash(/tmp/bypass-hdwallet-unlock.sh:*)",
"Bash(/tmp/fix-db-initialization.sh:*)" "Bash(/tmp/fix-db-initialization.sh:*)",
"SlashCommand(/code-review)"
], ],
"deny": [], "deny": [],
"ask": [] "ask": []

View File

@ -82,8 +82,8 @@ public class ProductService : IProductService
return await _context.Products return await _context.Products
.Include(p => p.Category) .Include(p => p.Category)
.Include(p => p.Photos) .Include(p => p.Photos)
.Include(p => p.MultiBuys.Where(v => v.IsActive)) .Include(p => p.MultiBuys)
.Include(p => p.Variants.Where(v => v.IsActive)) .Include(p => p.Variants)
.Where(p => p.IsActive && p.CategoryId == categoryId) .Where(p => p.IsActive && p.CategoryId == categoryId)
.Select(p => new ProductDto .Select(p => new ProductDto
{ {