diff --git a/backend/src/recipes/recipe-analysis.service.ts b/backend/src/recipes/recipe-analysis.service.ts index a4922719..6b5f0afd 100644 --- a/backend/src/recipes/recipe-analysis.service.ts +++ b/backend/src/recipes/recipe-analysis.service.ts @@ -82,7 +82,7 @@ export class RecipeAnalysisService { const pantryProductIds = new Set(pantryItems.map((p) => p.productId)); const userInventory = await this.prisma.inventoryItem.findMany({ - where: { userId }, + where: { product: { ownerId: userId } }, select: { productId: true }, }); const availableProductIds = new Set([ @@ -154,7 +154,7 @@ export class RecipeAnalysisService { } const inventoryItems = await this.prisma.inventoryItem.findMany({ - where: { productId: ingredient.productId, userId }, + where: { productId: ingredient.productId, product: { ownerId: userId } }, select: { quantity: true, unit: true }, });