add inventory

This commit is contained in:
2025-12-24 09:39:59 +03:30
parent 7da5c62d69
commit 774b670c52
+1 -1
View File
@@ -88,7 +88,7 @@ export class FoodService {
* Public food detail (only active foods are visible).
*/
async findPublicById(foodId: string, userId?: string): Promise<any> {
const food = await this.foodRepository.findOne({ id: foodId, isActive: true }, { populate: ['category'] });
const food = await this.foodRepository.findOne({ id: foodId, isActive: true }, { populate: ['category', 'inventory'] });
if (!food) throw new NotFoundException(FoodMessage.NOT_FOUND);
let isFavorite = false;
if (userId) {