This commit is contained in:
2025-11-25 09:36:55 +03:30
parent fb4ed33692
commit fdbc3c9dbe
4 changed files with 29 additions and 29 deletions
+6 -2
View File
@@ -70,8 +70,12 @@ export class FoodService {
return this.foodRepository.findAllPaginated(restId, dto);
}
async findAllByRestaurant(restId: string): Promise<Food[]> {
return this.foodRepository.find({ restaurant: { id: restId } });
async findAllByRestaurant(slug: string): Promise<Food[]> {
const restaurant = await this.restRepository.findOne({ slug });
if (!restaurant) {
throw new NotFoundException(RestMessage.NOT_FOUND);
}
return this.foodRepository.find({ restaurant: { slug } });
}
findOne(id: string) {