diff --git a/backend/src/recipes/recipe-analysis.service.ts b/backend/src/recipes/recipe-analysis.service.ts index ff9f8594..a4922719 100644 --- a/backend/src/recipes/recipe-analysis.service.ts +++ b/backend/src/recipes/recipe-analysis.service.ts @@ -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([ @@ -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 }, }); diff --git a/flutter/lib/features/admin/data/admin_repository.dart b/flutter/lib/features/admin/data/admin_repository.dart index be7abeeb..aa4ef06e 100644 --- a/flutter/lib/features/admin/data/admin_repository.dart +++ b/flutter/lib/features/admin/data/admin_repository.dart @@ -171,7 +171,7 @@ class AdminRepository { // ── Produkter ────────────────────────────────────────────────────────────── Future> listProducts() => - _getList(ProductApiPaths.list, AdminProduct.fromJson); + _getList(ProductApiPaths.mine, AdminProduct.fromJson); Future> listDeletedProducts() => _getList(ProductApiPaths.deleted, AdminProduct.fromJson);