feat: update inventory queries to filter by userId for accurate recipe analysis
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-06 10:32:35 +02:00
parent 3e27423f24
commit 7f15f8028b
2 changed files with 3 additions and 2 deletions
@@ -82,6 +82,7 @@ export class RecipeAnalysisService {
const pantryProductIds = new Set(pantryItems.map((p) => p.productId));
const userInventory = await this.prisma.inventoryItem.findMany({
where: { userId },
select: { productId: true },
});
const availableProductIds = new Set<number>([
@@ -153,7 +154,7 @@ export class RecipeAnalysisService {
}
const inventoryItems = await this.prisma.inventoryItem.findMany({
where: { productId: ingredient.productId },
where: { productId: ingredient.productId, userId },
select: { quantity: true, unit: true },
});