populate inventory

This commit is contained in:
2025-12-24 09:51:52 +03:30
parent 774b670c52
commit 805329e869
+1 -1
View File
@@ -104,7 +104,7 @@ export class FoodService {
* Admin food detail (scoped to the authenticated restaurant).
*/
async findAdminById(restId: string, id: string): Promise<Food> {
const food = await this.foodRepository.findOne({ id, restaurant: { id: restId } }, { populate: ['category'] });
const food = await this.foodRepository.findOne({ id, restaurant: { id: restId } }, { populate: ['category','inventory'] });
if (!food) throw new NotFoundException(FoodMessage.NOT_FOUND);
return food;