feat: update inventory queries to filter by userId for accurate recipe analysis
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -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 },
|
||||
});
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ class AdminRepository {
|
||||
// ── Produkter ──────────────────────────────────────────────────────────────
|
||||
|
||||
Future<List<AdminProduct>> listProducts() =>
|
||||
_getList(ProductApiPaths.list, AdminProduct.fromJson);
|
||||
_getList(ProductApiPaths.mine, AdminProduct.fromJson);
|
||||
|
||||
Future<List<AdminProduct>> listDeletedProducts() =>
|
||||
_getList(ProductApiPaths.deleted, AdminProduct.fromJson);
|
||||
|
||||
Reference in New Issue
Block a user