refactor food

This commit is contained in:
2025-12-17 09:06:03 +03:30
parent 1b42a0b4b4
commit 87534e8c6f
4 changed files with 34 additions and 23 deletions
@@ -13,7 +13,7 @@ export class CategoryService {
constructor(
private readonly categoryRepository: CategoryRepository,
private readonly em: EntityManager,
) {}
) { }
async create(restId: string, dto: CreateCategoryDto): Promise<Category> {
const restaurant = await this.em.findOne(Restaurant, { id: restId });
@@ -37,7 +37,7 @@ export class CategoryService {
if (!restaurant || !restaurant.id) {
throw new NotFoundException(RestMessage.NOT_FOUND);
}
return this.categoryRepository.find({ restaurant: restaurant });
return this.categoryRepository.find({ restaurant: restaurant, isActive: true });
}
async findAllByRestaurantId(restId: string): Promise<Category[]> {