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
@@ -40,8 +40,8 @@ export class FoodRepository extends EntityRepository<Food> {
}
if (categoryId) {
// filter by related categories (typed via FilterQuery)
Object.assign(where, { categories: { id: categoryId } } as unknown as FilterQuery<Food>);
// filter by related category (Food has a single `category` relation)
Object.assign(where, { category: { id: categoryId } } as unknown as FilterQuery<Food>);
}
const [data, total] = await this.findAndCount(where, {